1、Stable Diffusion是什么
- Stable Diffusion是2022年發(fā)布的深度學(xué)習(xí)文本到圖像生成模型。它主要用于根據(jù)文本的描述產(chǎn)生詳細(xì)圖像,盡管它也可以應(yīng)用于其他任務(wù),如內(nèi)補(bǔ)繪制、外補(bǔ)繪制,以及在提示詞?(英語(yǔ))指導(dǎo)下產(chǎn)生圖生圖的翻譯。
- Stable Diffusion是由德國(guó)慕尼黑大學(xué)機(jī)器視覺(jué)與學(xué)習(xí)研究小組和Runway的研究人員基于CVPR2022的一篇論文:《High-Resolution Image Synthesis with Latent Diffusion Models》,并與其他社區(qū)團(tuán)隊(duì)合作開(kāi)發(fā)的一款開(kāi)源模型。
2、深度學(xué)習(xí)環(huán)境搭建
- Anaconda下載與安裝:地址
- Pycharm(IDE)下載與安裝:地址
- CUDA、CuDNN下載與安裝:地址
3、Stable Diffusion環(huán)境搭建(可跳過(guò))
參考資料:地址
程序下載:地址
模型下載:地址
Github下載項(xiàng)目并打開(kāi)運(yùn)行,缺一小部分庫(kù)。
打開(kāi)終端,安裝相關(guān)庫(kù)
pytorch_lightning, omegaconf, einops
或者使用conda創(chuàng)建虛擬環(huán)境一鍵安裝依賴
conda env create -f environment.yaml
conda activate ldm
下載權(quán)重
地址
在項(xiàng)目目錄models/ldm下手動(dòng)創(chuàng)建stable-diffusion-v1文件夾,用來(lái)存放下載好的權(quán)重文件,即需要把下載文件夾里的sd-v1-4.ckpt文件改名為model.ckpt,然后粘貼到手動(dòng)創(chuàng)建的stable-diffusion-v1文件夾下即可
遇到報(bào)錯(cuò)NameError: name ‘trainer’ is not defined. Did you mean: ‘Trainer’?
根據(jù)官方wiki的教程進(jìn)行修補(bǔ) 地址
報(bào)錯(cuò)2
地址
4、Stable Diffusion WebUI環(huán)境搭建(主要)
Github下載star最多的stable-diffusion-webui項(xiàng)目(自帶圖形化包)
地址
-
使用conda創(chuàng)建python.3.10.6虛擬環(huán)境
conda create -n stable-webui python=3.10.6 -
激活虛擬環(huán)境
conda activate stable-webui -
進(jìn)入剛剛git clone的目錄,運(yùn)行webui-user.bat
等待自動(dòng)安裝進(jìn)度條 -
根據(jù)提示增加一些git配置信息
git config --global --add safe.directory xxx/stable-diffusion-webui/repositories/taming-transformers -
修改配置文件
增加—share解決本地localhost權(quán)限問(wèn)題 -
繼續(xù)執(zhí)行webui-user.bat,成功啟動(dòng)服務(wù)
-
改一下參數(shù),網(wǎng)上復(fù)制一段描述性的話,使用默認(rèn)模型隨機(jī)生成幾張圖。
5、NovelAI模型的修改與調(diào)參
模型可以在網(wǎng)上資源貼中下載合適的模型(.ckpt),放到models\Stable-diffusion里。
比如:地址
這里我們選擇NovelAI泄漏的完整版本,用于二次元繪畫(huà)
使用剛才的參數(shù)直接訓(xùn)練一下
描述詞
{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
- 然后是img2img,我們?cè)黾咏Y(jié)果與原圖的不同程度,得到如下
6、Chilloutmix-Ni模型
模型尋找攻略:1
2
-
然后我們?cè)贀Q用常用的3D模型生成一些圖
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-800733.html
-
最后我們使用真人模型Chilloutmix-Ni進(jìn)行訓(xùn)練
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-800733.html
到了這里,關(guān)于win10部署NovelAI繪畫(huà),Stable Diffusion,Chilloutmix,實(shí)現(xiàn)txt2img,img2img(含調(diào)參)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!