AI绘图入门 安装 stable-diffusion-webui

下面介绍了N卡,A卡,或CPU跑 stable-diffusion-webui的方法。

先看样张:

1.安装python 3.10.x

https://www.python.org/downloads/

2.安装Git

Git – Downloads (git-scm.com)

3、克隆stable-diffusion-webui项目

1. 新建文件夹

(不能有中文,建议放在空闲比较多的硬盘上),然后再文件夹打开命令行

#【非必要】如果有代理工具(比如clash),在命令行配置git的http和https代理:
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
#取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

2. 克隆

Nvidia显卡

# Nvidia
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

AMD显卡 AMD GPU 说明

# AMD
git clone https://github.com/lshqqytiger/stable-diffusion-webui-directml.git

#第一次启动会自动下载下面两个库
#git clone https://github.com/lshqqytiger/k-diffusion-directml.git
#git clone https://github.com/lshqqytiger/stablediffusion-directml.git
#把k-diffusion-directml里面文件放入:repositories\k-diffusion
#把stablediffusion-directml里面文件放入:stable-diffusion-stability-ai

CPU 选择上面任意一个都可以

下载慢可以请求头加https://ghproxy.com/ 如: https://ghproxy.com/https://github.com/***

4.下载模型

SD_v1.5 Inpainting

BRA(Beautiful Realistic Asians) V5 – Brav5 | Stable Diffusion Checkpoint | Civitai

ChilloutMix – Chilloutmix-Ni-pruned-fp32-fix | Stable Diffusion Checkpoint | Civitai

majicMIX realistic – v4 | Stable Diffusion Checkpoint | Civitai

下载.ckpt文件,并放在项目的models/Stable-diffusion目录下

5、启动项目

.\webui-user.bat
# 如果爆显存修改 webui-user.bat 文件中 set COMMANDLINE_ARGS= 后面的值
set COMMANDLINE_ARGS= --medvram --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check --enable-insecure-extension-access --no-gradio-queue

# 如果还是爆显存 启用低性能模式
set COMMANDLINE_ARGS=  --lowvram --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check --enable-insecure-extension-access --no-gradio-queue  --listen  

# 如果没有显卡 用CPU跑
set COMMANDLINE_ARGS= --use-cpu all --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check --enable-insecure-extension-access --no-gradio-queue

启动成功,浏览器输入:http://127.0.0.1:7860/

测试:
界面
界面

扩展

举例:正向提示

best quality, ultra-detailed, masterpiece, finely detail, highres, 8k wallpaper,beautiful detailed eyes,highly detailed skin,extremely delicate and beautiful girls,masterpiece, best quality, girl, black hair, cute face, longeyelashes, black eyes, mature, crossed bangs, hair over shoulder, light blush, wide eyed,  pleated_skirt,earrings, cityscape, real,upper body

举例:反向提示

mutated hands and fingers,text,title,deformed, bad anatomy, disfigured, poorly drawn face, mutation, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, out of focus, long neck, long body

选关键词生成器

https://tag.redsex.cc/
https://thereisnospon.github.io/NovelAiTag/

模型下载网站

https://civitai.com/
https://www.liblibai.com/
https://models.paomiantv.cn/models

人物起手

(best quality), (masterpiece), (highres), original, extremely detailed 8K wallpaper, (extremely delicate and beautiful), illustrations,hand of guido daniele,beautiful face,detail fingers,beautiful detailed eyes,

光影人物起手

cinematic light, colorful, hyper detail,dramatic light,light_hair, intricate details, best quality, (extremely detailed CG unity 8k wallpaper, masterpiece, best quality, ultra-detailed, best shadow), (detailed background), (beautiful detailed face, beautiful detailed eyes), High contrast, (best illumination, an extremely delicate and beautiful), dynamic angle,beautiful detailed glow,

反向

extra fingers,fused fingers,poorly drawn face,cloned face,extra legs,poorly drawn asymmetric eyes,poorly drawn hands,blurry,(worst quality, low quality:1.4), (malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(extra limbs:1.35),(poorly drawn face:1.4), badv3

高清起手

(RAW photo:1.2), (photorealistic:1.4), (intricate details:1.2),  (best quality:1.4), (delicate), (detailed eyes), (detailed facial features), dynamic pose, petite, narrow waist, slim_legs,

常用插件

中文

扩展搜索:zh_Hans Localization

然后再设置中,选择User interface 中 Localization (requires restart) 选择zh-Hans (Stable)

或者

扩展搜索:zh_CN Localization

然后再设置中,选择 Bilingual Localization 启用 Enable Devtools Log 再选择zh-Hans (Stable)。

(必须先关闭User interface中的翻译)

图库浏览器

扩展搜索:image browser

自动tag 中文tag

扩展搜索:Booru tag autocompletion

然后去下载词库:https://www.bilibili.com/video/BV1Bg4y1H7Tq http://www.123114514.xyz/WebUI/Tag

然后把压缩包a1111-sd-webui-tagcomplete.zip中的tag/zh_cn.csv 和 tag/zh_cn_tr.csv 解压放入extensionsa1111-sd-webui-tagcomplete\tags 文件夹中。

然后在设置 标签自动补全中:Tag filename =zh_cn.csv 然后设置 Search by translation=zh_cn_tr.csv

图片放大

扩展搜索:Ultimate SD Upscale

局部细节放大

扩展搜索:LLuL

草图转图片

扩展搜索:sd-webui-controlnet

然后去下载模型 lllyasviel/ControlNet-v1-1 at main (huggingface.co) 放入 extensions\sd-webui-controlnet\models 文件夹

超级模型融合

扩展搜索:SuperMerger

样张


整理了这么久,点个赞,点个关注吧。

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2023年12月23日
下一篇 2023年12月23日

相关推荐