stable-diffusion-webui使用和配置

WHY

随着 stable-diffusion-SDXL-1.0发布,text2img的效果越来越好了,加上正好买了2080Ti 22G,于是准备实施SD

硬件

硬件 型号
显卡 2080Ti 22G (魔改)
CPU i7-10070
内存 32G

安装 & 启动

当前我是在windows上安装,需要先安装python 3.10

1
2
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
.\webui-user.bat

执行后,会看到一些打印,当看到Running on local URL: http://0.0.0.0:7860 就算启动成功了,通过浏览器访问http://ip:7860 即可

1
2
3
4
5
6
7
8
9
(venv) PS D:\projs\stable-diffusion-webui> .\webui-user.bat    
venv "D:\projs\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.5.2
Commit hash: c9c8485bc1e8720aba70f029d25cba1c4abf2b5c
Launching Web UI with arguments: --listen --xformers --no-half-vae
Loading weights [31e35c80fc] from D:\projs\stable-diffusion-webui\models\Stable-diffusion\sd_xl_base_1.0.safetensors
Creating model from config: D:\projs\stable-diffusion-webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
Running on local URL: http://0.0.0.0:7860

模型配置

配置SDXL 1.0

参考这个回复

  1. 下载模型
  2. 将模型放到models/Stable-diffusion目录
  3. webui-user.bat中的COMMANDLINE_ARGS=后增加--no-half-vae参数,例如
    1
    set COMMANDLINE_ARGS=--listen --xformers --no-half-vae

注意:SDXL 1.0 需要32G内存

配置style

参考这个讨论

style.csv放到代码根目录,然后重启项目即可

这样在style下拉菜单就能看到各种style

Alt text

screenshot

  • 例一:
    prompt:

    1
    photo of a male warrior, modelshoot style, (extremely detailed CG unity 8k wallpaper), full shot body photo of the most beautiful artwork in the world, medieval armor, professional majestic oil painting by Ed Blinkey, Atey Ghailan, Studio Ghibli, by Jeremy Mann, Greg Manchess, Antonio Moro, trending on ArtStation, trending on CGSociety, Intricate, High Detail, Sharp focus, dramatic, photorealistic painting art by midjourney and greg rutkowski

    neg prompt

    1
    canvas frame, cartoon, 3d, ((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((close up)),((b&w)), weird colors, blurry, (((duplicate))), ((morbid)), ((mutilated)), [out of frame], extra fingers, mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), ((ugly)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), out of frame, ugly, extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck))), Photoshop, video game, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, mutation, mutated, extra limbs, extra legs, extra arms, disfigured, deformed, cross-eye, body out of frame, blurry, bad art, bad anatomy, 3d render

    Alt text

    参考自:https://github.com/FurkanGozukara/Stable-Diffusion/blob/main/Tutorials/How-To-Use-SDXL-Locally-With-Automatic1111-SD-Web-UI.md

TODO

  • 收集一些Prompt和插件
  • 调试refine