Skip to content

Stable diffusion进阶


title: 'stable diffusion进阶: Controlnet,Composable Lora,Latent Couple' date: 2023-6-30 14:18:36 categories: - [机器学习] excerpt: stable diffusion进阶


Controlnet

插件地址:https://github.com/Mikubill/sd-webui-controlnet 模型下载地址:https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main 参考资料:https://zhuanlan.zhihu.com/p/633777317

安装

  1. 安装插件
  2. 下载依赖(sd启动的时候也会自动下载,但是慢)cd ./extensions/sd-webui-controlnet, 执行pip install -r requirements.txt
  3. 下载模型,到https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main 下载,注意模型的名称要和./extensions/sd-webui-controlnet/models里面的.yaml文件一一对应

使用

图片转线稿生成

应用模型:Canny Sampling method: DPM++ SDE Karras Controlnet设置 - 点击Allow Preview打开预览窗口 - 选择Canny对应的预处理器和模型 - 点击中间的按钮预览线稿 - Control Mode: 选My prompt is more important会保留更多lora的特征,而选balance会更倾向于原图

  • 然后再在上面配置好prompt和相应的lora等,最后点击Generate生成

    aab848d0d48a660e73a222de6e328d2e.png

使用例(设置见右下):

7af261262ba2a064da679336ed4fd5f7.png

Composable Lora+Latent Couple 生成多人图片

参考资料: https://www.bilibili.com/video/BV1UY4y1U7jX/?share_source=copy_web&vd_source=5b7891dddad014bb3e32e3b881123379

使用

[共同的prompt]
AND <lora:模型1:权值1>  角色1prompt 注意增加一些交互动作,如looking at another, eye contact等
AND <lora:模型2:权值2>  角色2prompt

一个prompt示例

photorealistic, (hyperrealistic:1.2) , 4k , masterpiece, (masterpiece:1.3),(best quality:1.3), (((2girls))), (kiss) each other 
AND  <lora:ShigureLORA-000006:0.85>  shigure \(kancolle\), long hair, single braid, hair flaps,looking at another, eye contact, kiss another, 2girls, masterpiece, leaning against wall, blush, sweat, tears, 
AND  <lora:yuudachi_(kancolle)_v1:0.7>poi2, yuudachi kai ni \(kancolle\), hair flaps, white scarf, hairclip, red neckerchief, black serafuku, black skirt, fingerless gloves, black shirt, ooking at another,eye contact, kiss another,2girls,masterpiece, 

cccd119dfb1ea6a2f1988b128863fe00.png

Lora细节修复

模型:https://civitai.com/models/58390/detail-tweaker-lora-lora 权重不要太高,0.3~0.4足以 负权重可以减少细节

Comments