type
Post
status
Published
date
Feb 21, 2023
slug
AI_Pictures_stable_diffusion_webui
summary
简单记录使用AI生成图片(小姐姐)的过程
tags
Develop
category
Tech
icon
password

目前来看,AI绘图已经越来越火,模型基础已经被测试得差不多了,已经能基本稳定生成模型,因而在这个时候刚好有点空闲,想自己搭建一个ai平台来玩一玩。

本来我一开始的想法是自己找云服务商搭建,于是我去测试使用了谷歌云和Vultr,两者网上都有教程,但是后来我在查资料的时候发现已经有更加方便的方案,也为了读者能够更好入手,我推荐使用国内GPU云服务器服务商智星云,可以直接点击链接直达:
我认为还是性价比很高的,我使用基础版的配置如下:
notion image
 
点击立即使用,需要先注册账户,通过微信付款后就可以打开网页进行访问和使用了。找到我们购买的服务器链接,点击下面的WEBUI地址:
notion image
点击图中的点击跳转,就会来到一个新的界面,复制刚刚的用户名和密码:
notion image
 
首先测试生成2次元图,推荐模型是anything-v3,安装好就会自带该模型:
notion image
Prompt: best quality, masterpiece, beautiful detailed blue eyes, {{1little girl}}, light brown hair, bangs, blush, bow, white skirt, collarbone, cowboy shot, sidelocks, hair between eyes, hair bow, pink jacket, long hair, open clothes, open jacket, small pink nipples , open mouth, paw pose, red bow, shirt, sidelocks, simple background, skirt, white background, white shirt, {{{masterpiece}}}, {{{little round breast}}}, {{yellow star hair ornament}}, nsfw Negative Prompt: lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet (提示:对着一行三次点击鼠标左键即可选中整行) (需要注意,一般negative是不需要更改的,你只需要更改Prompt即可生成想要的结果)
 
 
以下是我的一些个人使用心得:
notion image
 
 
如果想使用自己的模型,下面的模型为很著名的ChilloutMix模型(三次元日本少女模型):
ChilloutMix | Stable Diffusion Checkpoint | Civitai
What a lovely movie!!!Check it!!https://vt.tiktok.com/ZS8m58kGs/When I made samples,My eta (see setting) was "0".And ESND was "1"Now,I canged them to eta to "0.67" and ESND "31337"(20/Feb/2023)よいこのみんなは節度を守って楽しもうな!!職場や家族の前で開くのはやめておいたほうがいいよ!!当モデルを転売することは認めていません。生成された画像の取り扱いには、自己責任の上、十分注意してください。当モデルを使用したことを明記せずに生成された画像を公開することや商用利用は認めていません。AIコミュニティの発展に悪影響を与えるような行動や個人の権利やプライバシーを侵害するような利用は禁止します。New merge model for 2.5D illustration here!!https://civitai.com/models/9291/sunshinemix↑(少しイラスト寄りにしたのもあります。)IMPORTANT:First of all, I never suggest regenerate images of “real “person,but, photo "realistic" images.本人郑重声明:本模型原则上禁止用于训练基于明星、公众人物肖像的风格模型训练,因为这会带来争议,对AI社区的发展造成不良的负面影响。如各位一定要违反以上声明训练相关模型并公开发布,请在您的发布说明中删除与本模型有关的一切描述。感谢各位使用者的支持与理解。I solemnly declare: In principle, this model is prohibited from being used for training style models based on portraits of celebrities and public figures, because it will cause controversy and have a negative impact on the development of the AI community. If you must violate the above statement to train the relevant model and release it publicly, please delete all descriptions related to this model in your release notes. Thank you for your support and understanding.I'm appreciate you enjoy my model.But, it might cause legal conflicts if you made some works/Loras/Embeddings named with actual person/copyright.I beg you never to put them with my model.If you can't be with actual name/copyright, just remove my model from your works.I never suggest to regenerate actual persons/copyright with my models.And I never want any legal conflicts from my models.PLEASE!! Care about legal conscious and privacy!!Show what your favorite works from this mergeon comments, if you like this mix.I wanna see and share your good ideas from this merge. :)It’s my pleasure.Let's share your good ideasand enjoy this merge!!(Some funs have already put their great works from this merge.It could be like a kind of community.)I started to put some tips with samples/prompts on review.Try to find them!!(I've already put 5. 14/Feb/2023)(I'm sorry but I stop to invite my discord.)<EXPLANATION of this model>Konnichiwa!!!!・This is Merged "Basilmix"(nuigurumi/basil_mix · Hugging Face)+ wonderful realistic models.(PoV Skin Texture - r34 Lucid Black | Stable Diffusion Checkpoint | CivitaiPoV Skin Texture - Dreamlike r34 | Stable Diffusion Checkpoint | Civitaiby twilightBOO)・Use: vae-ft-mse-840000(←!!)stabilityai/sd-vae-ft-mse-original at main (huggingface.co)1. Get vae-ft-mse-840000-ema-pruned.safetensor2. Put it in folder(models>VAE)3. Set VAE on webUI(Settings>Stable diffusion>SD VAE)4. Don't forget to push "Apply settings"(Your picture would be foggy, if you didnt use vae with this merge.)You dont need to use VAE with the latest ver."Chilloutmix-Ni"・All sample images have been upscaled using highrexfixAnd, I made some samples when I made test ckpt file for myself.I made safetensor file after that.(Cuz, ckpt files couldnt be liked on this site, because they include arbitrary code.)That’s why Prompts from some sample pictures wouldn't make the same pictures,sorry.・I think this model is not perfect,but better for realistic Asian(+ other areas.Just try) .・Face variation is really limited.Use LORA or Embeddings as you like.(←!!)I like to use "Ulzzang-6500" embeddings (I used that for all sample images).This is my type....I couldn't avoid generating with this....You can get it here.(Thanks @jayp and @samo9t4gmailcom for telling me on comments.)↓https://www.reddit.com/r/sdnsfw/comments/yv8d3l/embedding_i_trained_for_korean_ulzzang_face/https://moritz.pm/files/ulzzang-6500.pthttps://oo.pe/https://moritz.pm/files/ulzzang-6500.pt(all 3 adress are the same files)Other EmbeddingsBy FapMagi Creator Profile | CivitaiPure Eros Face | Stable Diffusion TextualInversion | CivitaiBy Dcy:Asian face mixhttps://huggingface.co/dcy/AsiaFacemix/tree/main(Thanks for sharing @yatagarasu !!)As the same as other areas of this world, Asian are quite variated and there are quite lots of races, communities and nations in Asia.Who can tell you what is the typical Asian?'"Typical "could cause less variation.I've been coming to think face variation should be developed not on models, but on LORAs and also on embeddings.Because,results can be quite randomed if that was developed on models.(Yeah,I know random encounting could be also fun,though.)You can make ideal faces with LORAs, embeddings as you like.(Some examples of face variation by using some TI/HN/LORA)Some Lora could work very nice, even though they were made for 2D charas.They are notable that 2D charas Loras generate not only crothes, hair styles, but also facial features!!This model is likely to get bigger tits.If you like more smaller tits, try both of prompts,"(small breasts) and (fantasy breasts)"(Slim girl) maybe good.・Preparing:TASUKU2023/Chilloutmix · Hugging FaceI put explanation too much,sorry.ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーDue to using Dreamlike Diffusion 1.0, this model has the following license:LicenseThis model is licesed under a modified CreativeML OpenRAIL-M license.- You can't host or use the model or its derivatives on websites/apps/etc., from which you earn, will earn, or plan to earn revenue or donations. If you want to, please email us at contact@dreamlike.art- You are free to host the model card and files (Without any actual inference or finetuning) on both commercial and non-commercial websites/apps/etc. Please state the full model name (Dreamlike Diffusion 1.0) and include a link to the model card (https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0)- You are free to host the model or its derivatives on completely non-commercial websites/apps/etc (Meaning you are not getting ANY revenue or donations). Please state the full model name (Dreamlike Diffusion 1.0) and include a link to the model card (https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0)- You are free to use the outputs of the model or the outputs of the model's derivatives for commercial purposes in teams of 10 or less- You can't use the model to deliberately produce nor share illegal or harmful outputs or content- The authors claims no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in the license- You may re-distribute the weights. If you do, please be aware you have to include the same use restrictions as the ones in the license and share a copy of the modified CreativeML OpenRAIL-M to all your users (please read the license entirely and carefully) Please read the full license here: https://huggingface.co/dreamlike-art/dreamlike-diffusion-1.0/blob/main/LICENSE.md
使用方法稍微复杂点,我们需要单独下载该模型并放入webui的文件夹下,首先需要打开终端:
notion image
在打开的新界面复制下面的指令,可以一起选中复制粘贴然后回车,安装该模型的指令为:
cd /home/diffusion/stable-diffusion-webui/models/Stable-diffusion wget --output-document=chilloutmix_NiPrunedFp32Fix.safetensors https://civitai.com/api/download/models/11745
终端内下载过程,总共4GB内容,下载时间可能会有点慢,我测试的时候一开始是15M/s后面降速了,等待下载完即可:
notion image
 
——————分割线——————
前面如果没有执行错误或者显示error之类的,或者想下载其他模型的可以看看下面的原理,如果成功就可以跳过了
notion image
notion image
下载的本质是我去官网把模型链接下载地址复制后使用wget + URL下载,但是下载的文件名如上图会不是我们下载的模型的名字,AI画图就无法识别该模型,进而导入模型就有可能会出错。
所以如果出现错误或下载模型就使用下面的指令:
echo "这里是进入到指定的文件夹" cd /home/diffusion/stable-diffusion-webui/models/Stable-diffusion echo "这里要填入模型的下载链接,需要去掉括号" wget (你要下载的模型链接) echo "这里是给下载的模型重命名,修改后需要去掉括号,真正的名字记得保留文件后缀,两个文件名之间有空格" mv (你下载的名字(我上面的是11745)) (模型真正的名字)
——————分割线——————
 
完成后,打开网页进入后左上角就可以选择刚刚的模型,不行的话需要点一下旁边的刷新,
notion image
然后就可以填充prompt了,这里是我的一个测试例子:
prompt: ((small nipples:1)), wet,see-through:1.5,sheer,Erotic lingerie, translucent underwear,transparent underwear, 1girl, ((pantyhose: 1.5)), beautiful_face, navel, drunk, cold attitude,jitome, lace, feet, sleepy, blur_background, looking at viewer, facing front, ultra high res, (photorealistic:1.4), masterpiece,best quality,official art, (8k, RAW photo:1.2),(portrait:1.4),(long hair:1.31), cinematic lighting ,(solo:1.1),(natural breasts:1.4), (eyelashes:1.1), (depth of field:1.1), lens flare, (chromatic aberration:1.1), (caustics:1.1),pervert,curvy body,delicated, <lora:chikmix_V1:0.3>, <lora:fashionGirl_v35:0.2>, <lora:koreanDollLikeness_v10:0.1>, <lora:taiwanDollLikeness_v10:0.1>, <lora:nudify_v12:0.05> , <lora:hugeAssAndBoobs_v1:0.01>, (((((pureerosface_v1:0.5))))) negative prompt: bra, backlight, paintings, sketches, fingers, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, (outdoor:1.6), backlight,(ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.5), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (more than 2 nipples:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), lowers, bad hands, missing fingers, extra digit, (futa:1.1),bad hands, missing fingers
生成的效果如图:
notion image
综上为我本次的AI作画使用心得,个人感觉还是未来可期的!
 
Using Macbook pro to install Stable-diffusion-webuiNotion+Hexo is the real way to run a blog