研究比较火的艺术二维码图片生成,并在本机使用cpu跑两张二维码,使用Stable Diffusion及ControlNet插件。
使用Stable Diffusion需要调试参数所以在本地使用stable-diffusion-webui搭建,文档如下:
注意如果电脑没有gpu,需要修改/stable-diffusion-webui/webui-user.bat脚本,使用cpu运行 set COMMANDLINE_ARGS= —lowvram —precision full —no-half —skip-torch-cuda-test
下载好放到\stable-diffusion-webui\models\Stable-diffusion目录中 在webui中可以看到如下图:
其他checkpoint:
要使用ControlNet需要安装,ControlNet非常好玩可以做很多东西后续深入研究,文档如下:
步骤:
使用到control_v11f1e_sd15_tile.pth模型
放到\stable-diffusion-webui\extensions\sd-webui-controlnet\models
a. 选择GhostMix checkpoint
b. 选择img2img
c. 输入Prompt
a cubism painting of a town with a lot of houses in the snow with a sky background, Andreas Rocha, matte painting concept art, a detailed matte painting
d. 输入negative prompt
ugly, disfigured, low quality, blurry, nsfw
e. 上传生成好的原始二维码图片
f. 设置img2img选项
g. 在ControlNet里上传原始二维码图片
h. 设置ControlNet选项
i. 生成
房子参数:
a cubism painting of a town with a lot of houses in the snow with a sky background, Andreas Rocha, matte painting concept art, a detailed matte painting Negative prompt: ugly, disfigured, low quality, blurry, nsfw Steps: 50, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 2194810646, Size: 768x768, Model hash: e3edb8a26f, Model: ghostmix_v20Bakedvae, Denoising strength: 0.7, ControlNet: “preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1, starting/ending: (0.24, 0.9), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (-1, 1, -1)”, Version: v1.3.2
机器人参数:
light, futobot, cyborg, ((masterpiece),(best quality),(ultra-detailed), (full body:1.2), 1male, solo, hood up, upper body, mask, 1boy, male focus,white gloves, cloak, long sleeves, spaceship, lightning, hires Negative prompt: ugly, disfigured, low quality, blurry Steps: 50, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 2284077713, Size: 768x768, Model hash: e3edb8a26f, Model: ghostmix_v20Bakedvae, Denoising strength: 0.7, ControlNet: “preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1, starting/ending: (0.2, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (-1, 1, -1)”, Version: v1.3.2
使用本机cpu跑实在太慢,2两个小时才能跑出来一张艺术二维码图片,就不继续跑,后续搞个有gpu的机器跑。
参数说明:
文章参考: