未分类

使用stable-diffusion-webui 运行模型

环境

操作系统: Windows11
显卡: RTX2060 6GB 显存

安装Python

  • 下载 Python3.10.6
https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe
  • 安装
image.png

注意勾选 Add Python 3.10.6 to PATH ,然后一路下一步即可

image.png
  • 打开powershell, 确认安装成功
python --version
image.png

安装git

  • 下载git
https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/Git-2.41.0-64-bit.exe
image.png

完成安装

image.png

通过命令行git,下载开源项目

下载
  • 为了避免找不到开源项目,可以像上图中的我一样, 先在用户目录建立一个github文件夹,进入文件夹后,再下载开源项目
mkdir github
cd github
  • 下载
git clone --depth=1 https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

打开下载stable-diffusion-webu的目录, 双击运行webui-user.bat 脚本,脚本将从网络下载依赖包

image.png

下载依赖包要求电脑能顺利连接全球互联网,如果下载被中断,则需要魔法上网,我们可以签到白嫖魔法上网流量 https://www.v2fy.com/p/109-glados-2021-06-09/ 或者搞台阿里云自己搭建 https://www.v2fy.com/p/2023-03-01-v2ray-1677654246000/

  • 依赖包安装成功后,即可自动运行,浏览器访问http://127.0.0.1:7860 即可
image.png

模型都存储在 stable-diffusion-webui/models/Stable-diffusion

从https://civitai.com/ 下载优质模型

image.png
image.png

模型地址 https://civitai.com/models/43331/majicmix-realistic

将下载的模型放入目录stable-diffusion-webuimodelsStable-diffusion

image.png

在webui中刷新并选择刚刚放入的模型

image.png

点击喜欢的作品进入详情页

image.png

复制参数

image.png
blouse, light and shadow
Negative prompt: nsfw, ng_deepnegative_v1_75t,badhandv4, (worst quality:2), (low quality:2), (normal quality:2), lowres,watermark, monochrome
Size: 512x683, Seed: 321001525, Model: majicmix_realv6_fp16, Steps: 30, Sampler: Euler a, CFG scale: 7, Clip skip: 2, Model hash: e4a30e4607, Hires steps: 25, Hires upscale: 2, ADetailer conf: 30, Hires upscaler: 8x_NMKD-Superscale_150000_G, ADetailer model: face_yolov8s.pt, ADetailer version: 23.5.6.post0, ADetailer x offset: 0, ADetailer y offset: 0, Denoising strength: 0.14, ADetailer CFG scale: 7.0, ADetailer mask blur: 4, ADetailer dilate/erode: 8, ADetailer inpaint full: True, ADetailer inpaint width: 512, ADetailer inpaint height: 512, ADetailer inpaint padding: 0, ADetailer denoising strength: 0.12, ADetailer use inpaint width/height: True

粘贴参数

image.png

自动匹配参数

image.png

匹配完成

image.png

生成

image.png

报错缺失名为8x_NMKD-Superscale_150000_G 的 upscaler

image.png

google搜索搜索8x_NMKD-Superscale_150000_G

image.png

进入 https://huggingface.co/uwg/upscaler/tree/main/ESRGAN,下载

image.png

将下载好的文件** 8x_NMKD-Superscale_150000_G.pth
**放入stable-diffusion-webuimodelsESRGAN

image.png

重启stable-diffusion-webui ,刷新webui页面,重新录入参数,点击Generate生成图片

image.png

如果图片生成失败,爆显存

image.png

查阅https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimizations

image.png

在webui-user.bat中添加--lowvram , 这里启用低内存模式,用时间换空间

image.png

重启stable-diffusion-webui ,刷新webui页面,重新录入参数,点击Generate生成图片

image.png
00001-321001525.png

我们可以还改变种子,生成类似的图片

image.png

比如我将种子设置为321001543 就可以生成这样一张图片

image.png
00002-321001543.png

我们也可以设置随机种子,连续生成多张

image.png
00006-2452012970.png
blouse, light and shadow
Negative prompt: nsfw, ng_deepnegative_v1_75t,badhandv4, (worst quality:2), (low quality:2), (normal quality:2), lowres,watermark, monochrome
Steps: 30, Sampler: Euler a, CFG scale: 7, Seed: 2452012970, Size: 512x683, Model hash: e4a30e4607, Model: majicmixRealistic_v6, Denoising strength: 0.14, Clip skip: 2, Hires upscale: 2, Hires steps: 25, Hires upscaler: 8x_NMKD-Superscale_150000_G, Version: v1.3.2

最后,放一张四联图

grid-0001.png

image.png

jovi

AiCC : AI Creative Commons AI 设计,关注 AiCC 知识共创! AiCC.pro

发表回复

相似文章

Back to top button