installation

stable-diffusion-webui

  • Install Python 3.10.6 (Newer version of Python does not support torch), checking "Add Python to PATH".
  • Install git.
  • Download the stable-diffusion-webui repository, for example by running git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git or git clone git@github.com:AUTOMATIC1111/stable-diffusion-webui.git.
  • Run webui-user.bat from Windows Explorer as normal, non-administrator, user. (It may cost much time(almost 20min~1hour))
    • if 'RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check' occurs, edit webui-user.bat and append --skip-torch-cuda-test to COMMANDLINE_ARGS. my runnable script is set COMMANDLINE_ARGS= --precision full --no-half --skip-torch-cuda-test. annonce that there is a space after =.
    • there will be http://127.0.0.1:7860 in console, which indicates a successful installation.

usage

visit http://127.0.0.1:7860.

  • if you got Expecting value: line 1 column 1 (char 0) in home page or after click generate button. check and close your proxy.

model

目前个人理解,模型分为checkpoint和lora。前者比较大(1G以上),是底图,lora模型是用来微小微调的(比较小,100M以下)。

1、CKPT(CheckPoint)
经过训练的图片合集,被称作模型,也就是chekpoint,体积较大,一般真人版的单个模型的大小在7GB左右,动漫版的在2-5个G之间。早期的CKPT后缀名是ckpt,如今新的CKPT后缀名都是safetensors

2、Lora是一种体积较小的绘画模型,是对大模型的微调。与每次作画只能选择一个大模型不同,lora模型可以在已选择大模型的基础上添加一个甚至多个。一般体积在几十到几百兆左右。后缀也是safetensors.

checkpoint模型放到 stable-diffusion-webui 项目的 models/Stable-diffusion/目录下。

lora模型放到 stable-diffusion-webui 项目的 models/Lora/ 目录下。

https://civitai.com/models

checkpoint模型:

已尝试的模型:

要放到 stable-diffusion-webui 项目的 models/Lora/ 目录下。之后就可以在http://127.0.0.1:7860/的lora标签页下看到mix4

<lora:mix4:0.7>, mix4, <lora:20d:0.5>, 20d, solo, long_hair, shirt, dress, high_heels,full_body, look_at_viewer, (8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37), professional lighting, photon mapping, radiosity, physically-based rendering,
Negative prompt: paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand (low quality, worst quality:1.4), (bad_prompt:0.8), (monochrome), (greyscale)

Size: 512x1024, Seed: 2144095954, Model: chilloutmix_NiPrunedFp32Fix, Steps: 30, Sampler: DPM++ SDE Karras, CFG scale: 8, Model hash: fc2511737a, Face restoration: CodeFormer
masterpiece, best quality,realistic,1girl,(hanfu, pink short shan,  gradient green pleated skirt, pink songmo),<lora:hanfuSong_v35:0.6>, upper body
Negative prompt: nsfw,ng_deepnegative_v1_75t, badhandv4, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), watermark, (bad-hands-5:1.5),<lora:neg_hands_qlsz:1>
Steps: 25, CFG scale: 8, Sampler: DPM++ 2S a Karras, Seed: 506783545, Size: 640x768, Model: beautifulRealistic_brav5, Version: v1.4.0, Model hash: ac68270450, Hires upscale: 1.5, "hanfuSong_v35: b24ad10e9dcc", Hires upscaler: R-ESRGAN 4x+, Face restoration: CodeFormer, Denoising strength: 0.5

https://www.4b3.com/item?a_model=stable-diffusion

liblib中需要付费才能下载模型(但是模型里的示例图片的提示词可以在sd中使用):

goal

根据图片生成写真

AI摄影写真
油画
科幻画
复古
国风

https://www.bilibili.com/video/BV16v2hYVEA5/

常用插件

git@github.com:facebookresearch/segment-anything.git

api

https://juejin.cn/post/7272730422735061044

作者:张三  创建时间:2024-12-09 17:49
最后编辑:张三  更新时间:2025-04-05 21:48