参考资料:地址
程序下载:地址
模型下载:地址
打开终端,安装相关库
pytorch_lightning, omegaconf, einops
或者使用conda创建虚拟环境一键安装依赖
conda env create -f environment.yaml
conda activate ldm
下载权重
地址
在项目目录models/ldm下手动创建stable-diffusion-v1文件夹,用来存放下载好的权重文件,即需要把下载文件夹里的sd-v1-4.ckpt文件改名为model.ckpt,然后粘贴到手动创建的stable-diffusion-v1文件夹下即可
遇到报错NameError: name ‘trainer’ is not defined. Did you mean: ‘Trainer’?
根据官方wiki的教程进行修补 地址
Github下载star最多的stable-diffusion-webui项目(自带图形化包)
地址
使用conda创建python.3.10.6虚拟环境
conda create -n stable-webui python=3.10.6
根据提示增加一些git配置信息
git config --global --add safe.directory xxx/stable-diffusion-webui/repositories/taming-transformers
模型可以在网上资源贴中下载合适的模型(.ckpt),放到models\Stable-diffusion里。
比如:地址
这里我们选择NovelAI泄漏的完整版本,用于二次元绘画
使用刚才的参数直接训练一下
描述词
{anime screenshot}(masterpiece, best quality, illustration, cinematic lighting,CG,wallpaper)
1 girl , beautifully detailed eyes,messy hair,long hair, flipped hair,Hair glows,pov,
blush,White hair,Red eyes,animal ears, looking at viewer,collar,dramatic angle,
(Intense POV) Highly detailed still professional portrait of anime film (a cute kawaii girl) destroyed in a tunic on a balcony in the city (overgrown with stuff), focus on the shoulders from above Pale skin on white marble glow very beautiful blue eyes pupil iris blush soft ambient light lens flare light particles beautiful composition window
排除词
multiple breasts, (mutated hands and fingers:1.5 ), (long body :1.3), (mutation, poorly drawn :1.2) , black-white, bad anatomy, liquid body, liquid tongue, disfigured, malformed, mutated, anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers, lowres, bad anatomy, bad proportions, bad shadow, uncoordinated body, unnatural body, fused breasts, bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid breasts, heavy breasts, missing breasts, huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, fused ears, bad ears, poorly drawn ears, extra ears, liquid ears, heavy ears, missing ears, fused animal ears, bad animal ears, poorly drawn animal ears, extra animal ears, liquid animal ears, heavy animal ears, missing animal ears, text, ui, error, missing fingers, missing limb, fused fingers, one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit, one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit, colorful tongue, black tongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game, 3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawn feet, fused feet, missing feet, extra shoes, bad shoes, fused shoes, more than two shoes, poorly drawn shoes, bad gloves, poorly drawn gloves, fused gloves, bad cum, poorly drawn cum, fused cum, bad hairs, poorly drawn hairs, fused hairs, big muscles, ugly, bad face, fused face, poorly drawn face, cloned face, big face, long face, bad eyes, fused eyes poorly drawn eyes, extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples, poorly drawn nipples, black nipples, colorful nipples, gross proportions. short arm, (((missing arms))), missing thighs, missing calf, missing legs, mutation, duplicate, morbid, mutilated, poorly drawn hands, more than 1 left hand, more than 1 right hand, deformed, (blurry), disfigured, missing legs, extra arms, extra thighs, more than 2 thighs, extra calf, fused calf, extra legs, bad knee, extra knee, more than 2 legs, bad tails, bad mouth, fused mouth, poorly drawn mouth, bad tongue, tongue within mouth, too long tongue, black tongue, big mouth, cracked mouth, bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, bad pantie, yellow teeth, thick lips, bad cameltoe, colorful cameltoe, bad asshole, poorly drawn asshole, fused asshole, missing asshole, bad anus, bad pussy, bad crotch, bad crotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch, fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorly drawn crotch seam, bad thigh gap, missing thigh gap, fused thigh gap, liquid thigh gap, poorly drawn thigh gap, poorly drawn anus, bad collarbone, fused collarbone, missing collarbone, liquid collarbone, strong girl, obesity, worst quality, low quality, normal quality, liquid tentacles, bad tentacles, poorly drawn tentacles, split tentacles, fused tentacles, missing clit, bad clit, fused clit, colorful clit, black clit, liquid clit, QR code, bar code, censored, safety panties, safety knickers, beard, furry ,pony, pubic hair, mosaic, excrement, faeces, shit
模型寻找攻略:1
2