侧边栏壁纸
博主头像
雲先生 博主等级

心死翼未伤,亦可去远方!

  • 累计撰写 46 篇文章
  • 累计创建 40 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

Mac本机部署Stable Diffusion web UI 尝试AI绘图

Administrator
2023-03-11 / 1 评论 / 0 点赞 / 210 阅读 / 0 字

准备Python环境

安装Anaconda

这一步不在这里细讲,直接安装即可。

准备为stable-diffusion创建指定版本的环境

我们这里用3.10.9版本的Python环境

查看所有的虚拟环境

conda env list

创建名为stable_diffusion的虚拟环境,且配置python版本为3.10.9

conda create -n stable_diffusion python=python=3.10.9

创建的环境在 /Users/zhy/opt/anaconda3/envs/ 目录下
也可以直接用Anaconda界面创建
准备Python环境

激活虚拟环境

source activate stable_diffusion

后面的运行要在这个环境里面

下载安装Stable Diffusion web UI

Git直拉取即可
https://github.com/AUTOMATIC1111/stable-diffusion-webui
由于我的Mac没有N卡跳过GPU 优化速度 ,打开webui-user.sh修改内容

export COMMANDLINE_ARGS="--medvram --opt-split-attention --skip-torch-cuda-test --no-half --use-cpu all"

到此基础安装完成

模型下载

https://civitai.com
https://huggingface.co/models?other=stable-diffusion
https://openai.wiki/painting/sd

模型放置在stable-diffusion-webui/models/Stable-diffusion
Lora模型放置在stable-diffusion-webui/models/Lora

启动

激活虚拟环境

source activate stable_diffusion

进入目录

cd /Users/zhy/work/workspace/PythonWorkspace/stable-diffusion-webui

运行

./webui.sh

启动完成后直接访问 http://localhost:7860/

汉化

1.打开stable diffusion webui,进入"Extensions"选项卡

2.点击"Install from URL",注意"URL for extension's git repository"下方的输入框

3.粘贴或输入本Git仓库地址
https://github.com/VinsonLaro/stable-diffusion-webui-chinese

4.点击下方的黄色按钮"Install"即可完成安装,然后重启WebUI(点击"Install from URL"左方的"Installed",然后点击黄色按钮"Apply and restart UI"网页下方的"Reload UI"完成重启)

5.点击"Settings",左侧点击"User interface"界面,在界面里最下方的"Localization (requires restart)",选择"Chinese-All"或者"Chinese-English"

6.点击界面最上方的黄色按钮"Apply settings",再点击右侧的"Reload UI"即可完成汉化

安装外挂使用Lora模型

Lora需要基于chilloutmix_NiPrunedFp32Fix模型,

1.先选择chilloutmix_NiPrunedFp32Fix模型

2.扩展插件---可用---加载
https://raw.githubusercontent.com/wiki/AUTOMATIC1111/stable-diffusion-webui/Extensions-index.md
选择Kohya-ss Additional Networks安装
加载失败就下载这MD文件,在里面找到Kohya-ss Additional Networks对应的Git地址
https://github.com/kohya-ss/sd-webui-additional-networks.git
然后选择用网址安装

3.安装完成后应用并重启UI界面

会发现多了一个Additional Networks的页签
在生成按钮下面多了一个红色的Show extra networks按钮,里面就可以看到扩展模型

简单测试

提示词

(ulzzang:0.4)1girl, kpop idol, yae miko, detached sleeves, pink hair, long hair, best quality, (photorealistic:1.2), (hair ornament:1.35), jewelry, purple eyes, earrings, large breasts, torii, cherry blossoms, lantern light, depth of field, detailed face, face focus, (looking at viewer:1.25), shiny skin, long sleeves, smile, thick lips, game cg, thighhighs, east asian architecture, blurry background, full body, arms behind back,hands behind,
<lora:yaeMikoRealistic_yaemikoMixed:0.75>,  <lora:koreanDollLikeness_v15:0.2> <lora:breastinclassBetter_v13:0.2> <lora:iu_V20:0.3>

反向提示词

EasyNegative, paintings, sketches, (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,, EasyNegative, paintings, sketches, (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, EasyNegative, paintings, sketches, (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

Eta: 0.667, ENSD: 31337, Size: 512x768, Seed: 3628792468, Model: chilloutmix_NiPrunedFp32Fix, Steps: 40, Sampler: DPM++ 2S a Karras, CFG scale: 7, Clip skip: 2, Model hash: fc2511737a
20230311175820
20230311180647
最后放一些AI画出来的图,大家欣赏一下,看能否看得出是AI画出来的
196385
194472
217590
199753
201963
217588
219132
156268
201964

0

评论区