首页AI 新闻
【SD新手教程】WebUI 使用说明
160

【SD新手教程】WebUI 使用说明

Mcmuffin
Mcmuffin
2023-03-13 19:27

安装好 Stable Diffusion WebUI 后,以后只需双击文件夹中的 webui-user.bat 即可启动。

下面介绍 Stable Diffusion WebUI 的几个基本功能:

提示词基本教学

无论使用哪种模式绘画,Stable Diffusion 都需要使用英文输入“正向”和“负向”提示词(即关键词)。

使用正向提示词来指导AI绘制图像,负向提示词则用于排除不必要的元素。

正向提示词可以包括指定某个画家的名字,以让AI尝试模仿其风格,也可以包括特定动漫或漫画中的角色名字和作品名称,让AI绘制出相应风格的二次创作。

例如,若要在A-1 Pictures的动画风格中随机绘制Fate/Grand Order中的贞德裸体图像,则正向提示词可以包括贞德的装甲或剑等身体特征、动画工作室"A-1 Pictures"的名称、作品名称"Fate/Grand Order"以及角色名称"贞德"。

负向提示词则可以包括指示不绘制衣物或不需要包含的元素或场景等不符合期望美学的内容。在使用提示词来控制绘画时,需要平衡正向和负向提示词的数量,并遵循正向提示词不超过150个字的原则。

如果使用Stable Diffusion模型,请参考Voldy整理的艺术家名单,如果是绘制动漫风格,则可参考Danbooru Artist标签库来确定适当的提示词。

art by a1_pictures, jeanne d'arc from fate grand order, GIRL,FEMININE, (BEST QUALITY), (MASTERPIECE), ((FULL FACE)) ((PERFECT FACE)),((SEXY FACE)), ((LOOKING AT VIEWER)), ((DETAILED PUPILS)), (THICK THIGH), SMIRK, (INTRICATE),(HIGH DETAIL),SHARP, (((FULL BODY))), (LARGE BREASTS), VAGINA, NUDE, NIPPLES

接下来,输入Hentai Diffusion提供的万能负向提示词,添加这些提示词可以防止生成不合适的图像,例如断手断脚的情况。并不需要全部使用提示词。

(((deformed))), blurry, bad anatomy, disfigured, poorly drawn face, mutation, mutated, (extra_limb), (ugly), (poorly drawn hands), fused fingers, messy drawing, broken legs censor, censored, censor_bar, multiple breasts, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2), black-white, bad anatomy, liquid body, liquidtongue, disfigured, malformed, mutated, anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers, low res, 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, missingbreasts, huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, fusedears, 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, liquidanimal 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 than5 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, blacktongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game, 3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawnfeet, 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, badeyes, fused eyes poorly drawn eyes, extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples, poorly drawnnipples, 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 longtongue, black tongue, big mouth, cracked mouth, bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, badpantie, yellow teeth, thick lips, bad camel toe, colorful camel toe, bad asshole, poorly drawn asshole, fused asshole, missing asshole, bad anus, bad pussy, bad crotch, badcrotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch, fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorlydrawn 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, futa, testis, (((deformed))), blurry, bad anatomy, disfigured, poorly drawn face, mutation, mutated, (extra_limb), (ugly), (poorly drawn hands), fused fingers, messy drawing, broken legs censor, censored, censor_bar, multiple breasts, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2), black-white, bad anatomy, liquid body, liquidtongue, disfigured, malformed, mutated, anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers, low res, 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, missingbreasts, huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, fusedears, 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, liquidanimal 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 than5 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, blacktongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game, 3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawnfeet, 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, badeyes, fused eyes poorly drawn eyes, extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples, poorly drawnnipples, 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 longtongue, black tongue, big mouth, cracked mouth, bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, badpantie, yellow teeth, thick lips, bad camel toe, colorful camel toe, bad asshole, poorly drawn asshole, fused asshole, missing asshole, bad anus, bad pussy, bad crotch, badcrotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch, fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorlydrawn 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, futa, testis

文生图txt2image

文生图txt2image可以让人工智能根据文字描述绘制图像。

在Stable Diffusion WebUI页面顶部可以看到正在使用的模型。切换模型需要大约30秒的时间。

  • 在页面上方填写正向和负向提示词。右侧有保存按钮。
  • 各种抽样方法得到的结果都不同,建议先尝试Euler A,再尝试DDIM,并尝试将Sampling Steps的值调整到30以上。WidthxHeight是输出图像的尺寸,保持默认即可,尺寸越大越耗费性能。
  • 建议勾选左下角的Restore faces。
  • 点击右上角的Generate开始绘图。
  • 根据显卡性能,图像约一分钟即可计算出来,点击放大并保存。
  • 左下角有Batch count的数值可设置一次计算多张图。
  • 如果对此次结果满意,不妨将Seed保存下来供日后使用,这样可以一定程度上保留风格。
杂项:Tiling可以计算出类似地板花纹一样可连续的图像;Hires_fix可以提升图像的画质;CFG_Scale代表的是绘图与你给出的提示词的相关度,数值越高越会按照你说的内容下去绘图。

无论图像是否保存,Stable Diffusion算出的图像都会自动保存在程序文件夹下的outputs文件夹中。

图生图img2img

画生画img2img是一种让AI根据现有的图片进行绘画的技术,举个例子,你可以上传一张真人照片,让AI将其画成动漫人物。

  • 首先点击框框上传图片。上传的图片比例需要与设定的绘制长宽比相同,例如512x512就需要上传比例为1:1的图片。
  • 同样填入正向和负向提示词,勾选恢复面孔,然后点击右上角的生成绘画按钮。
  • 画生画左下方有CFG Scale和Denoising strength这两个数值,它们决定与原图的相似程度。Denoising strength越小,与原图越相似,可用于微调绘画。

  • 右上角的"Interrogate Deepbooru"是在上传图片后,使用Danbooru图库的数据来判断图片并自动填充提示词,这样你会对提示词更有概念。

内部补偿Inpaint

内部补偿绘图是一种技术,可以让AI填充黑色区域,例如更换图像中角色的服装。或者反过来:让AI绘制完整的图片(outpaint),填充空白部分。

  • 上传图像,点击图像,使用鼠标将要替换的部分涂黑。

  • 假设要更换成泳装,那么在正向提示词中添加swimsuit或bikini这类提示词。
  • 左下角的Masked content有几个选项,fill即为填充新内容,original则是在填充内容时参考原图黑色下面的内容。
  • 点击Generate绘图。

用LoRA绘制特定人物画风

除了根据需要切换ckpt模型外,还可以增加几层网络以改善画风,并提高特定物体、角色的准确性。

例如,使用Anything模型进行绘图,再与“Taiwan-doll-likeness LoRA”结合,就可以将其转换成真人风格,而无需依赖太多提示词。此外,可以一次叠加多个模型,就像使用多层滤镜一样。

相对于ckpt大模型,这些模型的文件都很小,主要用于微调现有的模型。小型模型有三种:Embedding、HyperNetwork、LoRA,文件扩展名以.pt或.safetensors结尾,目前最受欢迎的是“LoRA”。更好的是,由于文件很小,自己训练喜欢的人物模型的成本并不高。

安装小模型

Civitai有许多小模型可供下载。在下载时,请注意哪种模型是什么。

  • 将Embedding放入stable-diffusion-webui文件夹下的embeddings中
  • 将HyperNetwork放入stable-diffusion-webui\models\hypernetworks中
  • 将LoRA放入stable-diffusion-webui\models\Lora中

如果要显示小型模型的缩略图,请使用与该模型相同的文件名命名图片,并将其放在该模型的目录中。例如,在Taiwan-doll-likeness.safetensors所在的目录中放一张Taiwan-doll-likeness.png。

小型模型的使用方法

进入WebUI,单击右上角的Show extra networks。

这样,菜单就会出现。以LoRA为例,单击小型模型的卡片,就会将其添加到提示词字段中,表示在绘图时使用LoRA。

接下来,再添加其他提示词,绘图就会采用LoRA的风格。

如果绘制出的图片太奇怪了,可以调整提示词字段中每个LoRA后面的数字,以控制权重。

好的,看起来已经好多了。

全部讨论

no data来都来了,坐下聊聊