欢迎光临散文网 会员登陆 & 注册

StableDiffusion绘图【各种特性最全示例】,你的WebUI究竟都能做些什么?

2023-04-09 19:11 作者:孤坟killr  | 我要投稿

内容:对GitHub网站上AUTOMATIC1111/SDWebUI项目下的Feature特性文档全文全图进行了机翻和重新排版。直接由web UI开发者撰写的特性说明文档。

意义:可以帮你系统理解该WebUI究竟都能做什么,应该怎么做。尤其适用于英文说明书读不懂,由于网络不稳定导致的GitHub进不去、示例图片加载不出等问题。

适用人群

如果有网络不稳等问题,不如收藏一下以备不时之需。

使用秋叶菩萨的一体化安装更新包的同学也不妨阅读一下,从底层理解一下WebUI。萌新可以帮助建立对SD的基本认识。

对于熟练的同学,本文中有大量的SD官方示例图,和一些很好的指导,可帮你增进对各种参数的细节理解。碰到疑难杂症不妨回来看看。

如果能够稳定上Github且英文阅读无障碍则无需本文,但欢迎指出错误与探讨交流。

本文原版来自https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features


以下是原文,内容是一行原文一行机翻。

由于是机翻可能存在一些问题,请结合上下文。

在转写成专栏的时候,原文中的超链接消失了(类似Moreinfo、SD2模型下载链接等),原文中实际上有很多超链接,感兴趣可以去github主页翻看。

This is a feature showcase page for Stable Diffusion web UI.

这是稳定扩散 Web UI 的功能展示页面。

All examples are non-cherrypicked unless specified otherwise.
除非另有说明,否则所有示例均未经挑选。

InstructPix2Pix指导下的图生图

Website. Checkpoint. The checkpoint is fully supported in img2img tab. No additional actions are required. Previously an extension by a contributor was required to generate pictures: it's no longer required, but should still work. Most of img2img implementation is by the same person.
网站。 检查站。检查点在img2img选项卡中完全受支持。无需执行其他操作。以前,需要贡献者的扩展才能生成图片:它不再需要,但应该仍然有效。大多数img2img的实现都是由同一个人完成的。

To reproduce results of the original repo, use denoising of 1.0, Euler a sampler, and edit the config in configs/instruct-pix2pix.yaml to say:
要重现原始存储库的结果,请使用 1.0 的去噪,Euler 采样器,并在 configs/instruct-pix2pix.yaml 中编辑配置以表示:

    use_ema: true
    load_ema: true

 instead of:

    use_ema: false

InstructPix2Pix示例

Extra network额外网络

A single button with a picture of a card on it. It unifies multiple extra ways to extend your generation into one UI.
一个按钮,上面有一张卡片的图片。它统一了多种额外方法,将生成扩展到一个 UI 中。

Find it next to the big Generate button: 
在大的“生成”按钮旁边找到它:

Extra networks按钮位置

Extra networks provides a set of cards, each corresponding to a file with a part of model you either train or obtain from somewhere. Clicking the card adds the model to prompt, where it will affect generation.
Extra Networks 提供了一组卡片,每张卡片对应一个文件,其中包含您训练或从某处获得的模型的一部分。单击卡片会将模型添加到提示中,它将影响生成。

几种额外网络及其存放目录、文件类型、使用方法

下面简介以下几种Extra network额外网络:

Textual Inversion

A method to fine tune weights for a token in CLIP, the language model used by Stable Diffusion, from summer 2021. Author's site. Long explanation: Textual Inversion
一种从 2021 年夏季开始微调 CLIP(稳定扩散使用的语言模型)中令牌权重的方法。 作者网站 .详细解释:文本反转

Lora

A method to fine tune weights for CLIP and Unet, the language model and the actual image de-noiser used by Stable Diffusion, published in 2021. Paper. A good way to train Lora is to use kohya-ss.
2021 年发布的一种微调 CLIP 和 Unet 权重的方法,语言模型和稳定扩散使用的实际图像降噪器。 纸。训练劳拉的一个好方法是使用 科希亚-ss.

Support for Lora is built-in into the Web UI, but there is an extension with original implementation by kohyaa-ss.
对Lora的支持内置于Web UI中,但是有一个由kohyaa-ss原始实现的扩展。

Currently, Lora networks for Stable Diffusion 2.0+ models are not supported by Web UI.
目前, Web UI 不支持稳定扩散的 Lora 网络 2.0+ 模型.

Lora is added to the prompt by putting the following text into any location: <lora:filename:multiplier>, where filename is the name of file with Lora on disk, excluding extension, and multiplier is a number, generally from 0 to 1, that lets you choose how strongly Lora will affect the output. Lora cannot be added to the negative prompt.
通过将以下文本放入任何位置将 Lora 添加到提示符中: <lora:filename:multiplier> ,其中 filename 是磁盘上带有 Lora 的文件的名称, 不包括扩展名, multiplier 是一个数字, 通常从 0 到 1, 让你选择 Lora对输出的影响程度.Lora不能添加到否定提示中.

The text for adding Lora to the prompt, <lora:filename:multiplier>, is only used to enable Lora, and is erased from prompt afterwards, so you can't do tricks with prompt editing like [<lora:one:1.0>|<lora:two:1.0>]. A batch with multiple different prompts will only use the Lora from the first prompt.
将 Lora 添加到提示符的文本, <lora:filename:multiplier> ,仅用于启用 Lora, 之后从提示中删除, 所以你不能像 [<lora:one:1.0>|<lora:two:1.0>] 这样的提示编辑来做技巧。具有多个不同提示的批处理将仅使用第一个提示中的 Lora.

Hypernetworks

A method to fine tune weights for CLIP and Unet, the language model and the actual image de-noiser used by Stable Diffusion, generously donated to the world by our friends at Novel AI in autumn 2022. Works in the same way as Lora except for sharing weights for some layers. Multiplier can be used to choose how strongly the hypernetwork will affect the output.
一种微调 CLIP 和 Unet 权重的方法,稳定扩散使用的语言模型和实际图像降噪器,由我们在 Novel AI 的朋友于 2022 年秋季慷慨捐赠给世界。工作方式与 Lora 相同,除了共享某些层的权重.乘数可用于选择超网络对输出的影响程度。

Same rules for adding hypernetworks to the prompt apply as for Lora: <hypernet:filename:multiplier>.
将超网络添加到提示符的规则与 Lora 相同: <hypernet:filename:multiplier> 。

Alt-Diffusion

A model trained to accept inputs in different languages. More info. PR.
经过训练以接受不同语言输入的模型。 更多信息 . 公关。

  • Download the checkpoint from huggingface. Click the down arrow to download.
    从拥抱脸下载检查点。单击向下箭头进行下载。

  • Put the file into models/Stable-Diffusion
    将文件放入 models/Stable-Diffusion

Notes: 

 注释:

Mechanically, attention/emphasis mechanism is supported, but seems to have much less effect, probably due to how Alt-Diffusion is implemented.

从机械上讲,注意力/强调机制是受支持,但似乎效果要小得多,这可能是由于Alt扩散的实现方式。

Clip skip is not supported, the setting is ignored.
不支持剪辑跳过,该设置将被忽略。

•           It is recommended to run with --xformers. Adding additional memory-saving flags such as --xformers --medvram does not work.

建议使用 --xformers. 运行 添加其他节省内存的标志(如 --xformers --medvram )不起作用。

Stable Diffusion 2.0 稳定扩散2.0

1.         Download your checkpoint file from huggingface. Click the down arrow to download.
从拥抱脸下载您的检查点文件。单击向下箭头进行下载。

2.         Put the file into models/Stable-Diffusion
将文件放入 models/Stable-Diffusion

•           768 (2.0) - (model, yaml)
•           768 (2.1) - (model+yaml) - .safetensors

•           512 (2.0) - (model, yaml)

Notes: (Click to expand:) 

注释:

If 2.0 or 2.1 is generating black images, enable full precision with --no-half or try using the --xformers optimization.

如果 2.0 或 2.1 正在生成黑色图像,请使用 --no-half 启用全精度或尝试使用 --xformers 优化。

Note: SD 2.0 and 2.1 are more sensitive to FP16 numerical instability (as noted by themselves here) due to their new cross attention module.

注意:SD 2.0 和 2.1 对 FP16 数值不稳定性更敏感(如此处所述),因为它们的新交叉注意力模块。

On fp16: comment to enable, in webui-user.bat:

在 fp16 上:注释以启用,在 webui-user 中.bat:

 Depth Guided Model 深度引导模型

The depth-guided model will only work in img2img tab. More info. PR.
深度引导模型仅适用于 img2img 选项卡。 更多信息 . 公关。

•           512 depth (2.0) - (model+yaml) - .safetensors
•           512 depth (2.0) - (model, yaml)

Inpainting Model SD2 修复模型 SD2

Model specifically designed for inpainting trained on SD 2.0 512 base.
专为在 SD 2.0 512 基础上进行修复训练而设计的模型。

•           512 inpainting (2.0) - (model+yaml) - .safetensors
inpainting_mask_weight or inpainting conditioning mask strength works on this too.

inpainting_mask_weight 或修复调理面膜强度也适用于此。

Outpainting外绘

Outpainting extends the original image and inpaints the created empty space.
外画扩展了原始图像并绘制了创建的空白空间。

Example示例:


Original原图
Outpainting外绘一次
Outpainting again外绘两次

Original image by Anonymous user from 4chan. Thank you, Anonymous user.

原始图片来自4chan的匿名用户。谢谢你,匿名用户。

You can find the feature in the img2img tab at the bottom, under Script -> Poor man's outpainting.
您可以在底部的img2img选项卡中找到该功能,在脚本->穷人的外画下。

Outpainting, unlike normal image generation, seems to profit very much from large step count. A recipe for a good outpainting is a good prompt that matches the picture, sliders for denoising and CFG scale set to max, and step count of 50 to 100 with Euler ancestral or DPM2 ancestral samplers.
与正常的图像生成不同,外画似乎从大步数中受益匪浅。一个好的外画的配方是一个很好的提示,它与图片、用于去噪的滑块和设置为 max 的 CFG 比例相匹配,并且步长计数为 50 到 100,与欧拉祖先或 DPM2 祖先采样器相匹配。

步数对外绘的影响

Inpainting局部重绘

In img2img tab, draw a mask over a part of the image, and that part will be in-painted.
在img2img选项卡中,在图像的一部分上绘制蒙版,该部分将被绘制。

inpainting 界面

Options for inpainting: 修复选项:

•           draw a mask yourself in the web editor
在 Web 编辑器中自己绘制蒙版

•           erase a part of the picture in an external editor and upload a transparent picture. Any even slightly transparent areas will become part of the mask. Be aware that some editors save completely transparent areas as black by default.
在外部编辑器中擦除图片的一部分并上传透明图片。任何稍微透明的区域都将成为遮罩的一部分。请注意,默认情况下,某些编辑器将完全透明的区域保存为黑色。

•           change mode (to the bottom right of the picture) to "Upload mask" and choose a separate black and white image for the mask (white=inpaint).
将模式(图片右下角)更改为“上传蒙版”,然后为蒙版选择单独的黑白图像(白色=重绘部分)。

Inpainting model重绘模型

RunwayML has trained an additional model specifically designed for inpainting. This model accepts additional inputs - the initial image without noise plus the mask - and seems to be much better at the job.
RunwayML训练了一个专门为修复而设计的附加模型。该模型接受额外的输入 - 没有噪声的初始图像加上掩模 - 并且似乎在工作中要好得多。

Download and extra info for the model is here: https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion
下载和模型的额外信息在这里: https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion

To use the model, you must rename the checkpoint so that its filename ends in inpainting.ckpt, for example, 1.5-inpainting.ckpt.
若要使用该模型,必须重命名检查点,使其文件名以 inpainting.ckpt 结尾,例如 1.5-inpainting.ckpt 。

After that just select the checkpoint as you'd usually select any checkpoint and you're good to go.
之后,只需选择检查点,就像您通常会选择任何检查点一样,您就可以开始了。

Masked content蒙版内容

The masked content field determines content is placed to put into the masked regions before they are inpainted. This does not represent final output, it's only a look at what's going on mid-process.
蒙版内容字段确定在对蒙版区域进行蒙版之前放置要放入遮罩区域的内容。这并不代表最终输出,它只是查看过程中发生的事情。

不同选项对应的重绘开始时遮罩下的内容

Inpaint area重绘区域

Normally, inpainting resizes the image to the target resolution specified in the UI. With Inpaint area: Only masked enabled, only the masked region is resized, and after processing it is pasted back to the original picture. This allows you to work with large pictures and render the inpainted object at a much larger resolution.
通常,重绘过程会将图像大小调整为 UI 中指定的目标分辨率。启用 Inpaint area: Only masked 后,会仅将遮罩区域调整为目标大小,并在处理后将其粘贴回原始图片。这允许您处理大图片并以更大的分辨率渲染修复对象。

示例,可以看出选上only masked后重绘的复杂度高了很多

Masking mode

There are two options for masked mode:
遮盖模式有两个选项:

•           Inpaint masked - the region under the mask is inpainted
重绘遮盖 - 蒙版下方的区域被重绘

•           Inpaint not masked - under the mask is unchanged, everything else is inpainted
重绘未遮盖不涂漆 - 蒙版下不变,其他一切都被重绘

Alpha mask

我也不知道这个是什么意思来着

Color Sketch彩色重绘

Basic coloring tool for the img2img tab. Chromium-based browsers support a dropper tool.  (this is on firefox)
img2img 选项卡的基本着色工具。基于 Chromium 的浏览器支持滴管工具。 (这是在火狐浏览器上)

colorsketch示例

Prompt matrix 提示词矩阵

Separate multiple prompts using the | character, and the system will produce an image for every combination of them. For example, if you use a busy city street in a modern city|illustration|cinematic lighting prompt, there are four combinations possible (first part of the prompt is always kept):
使用 | 字符分隔多个提示,系统将为它们的每个组合生成一个图像。例如,如果使用 a busy city street in a modern city|illustration|cinematic lighting 提示符,则有四种可能的组合(始终保留提示的第一部分):

•           a busy city street in a modern city

•           a busy city street in a modern city, illustration

•           a busy city street in a modern city, cinematic lighting

•           a busy city street in a modern city, illustration, cinematic lighting

Four images will be produced, in this order, all with the same seed and each with a corresponding prompt:
将按此顺序生成四个图像,所有图像都具有相同的种子,并且每个图像都有相应的提示:

示例

Another example, this time with 5 prompts and 16 variations:
另一个例子,这次有 5 个提示和 16 个变体:

示例

You can find the feature at the bottom, under Script -> Prompt matrix.
您可以在底部的脚本 -> 提示矩阵下找到该功能。

Stable Diffusion upscale 稳定扩散图片放大

*这一部分的机翻问题较大,高档、升级等都对应图片的放大,即分辨率增加

Upscale image using RealESRGAN/ESRGAN and then go through tiles of the result, improving them with img2img. It also has an option to let you do the upscaling part yourself in an external program, and just go through tiles with img2img.
使用RealESRGAN/ESRGAN的高档图像,然后浏览结果的图块,使用img2img对其进行改进。它还可以选择让您在外部程序中自己进行升级部分,只需使用 img2img 浏览磁贴即可。

Original idea by: https://github.com/jquesnelle/txt2imghd. This is an independent implementation.
原意: https://github.com/jquesnelle/txt2imghd .这是一个独立的实现。

To use this feature, select SD upscale from the scripts dropdown selection (img2img tab).
若要使用此功能,请选择 SD upscale from the scripts dropdown selection (img2img 选项卡)。

The input image will be upscaled to twice the original width and height, and UI's width and height sliders specify the size of individual tiles. Because of overlap, the size of the tile can be very important: 512x512 image needs nine 512x512 tiles (because of overlap), but only four 640x640 tiles.
输入图像将放大到原始宽度和高度的两倍,UI 的宽度和高度滑块指定各个磁贴的大小。由于存在重叠,磁贴的大小可能非常重要:512x512 图像需要 9 个 512x512 图块(由于重叠),但只需要 4 个 640x640 图块。

Recommended parameters for upscaling:
升级的推荐参数:

•           Sampling method: Euler a 采样方法:欧拉A

•           Denoising strength: 0.2, can go up to 0.4 if you feel adventurous
降噪强度:0.2,如果您喜欢冒险,可以达到0.4

使用不同upscaler放大器的效果,从左到右四列分别为:原图;Real ESRGAN;TopazGigapixel;SDupscale

Infinite prompt length 无限的提示长度

Typing past standard 75 tokens that Stable Diffusion usually accepts increases prompt size limit from 75 to 150. Typing past that increases prompt size further. This is done by breaking the prompt into chunks of 75 tokens, processing each independently using CLIP's Transformers neural network, and then concatenating the result before feeding into the next component of stable diffusion, the Unet.
输入超过稳定扩散通常接受的标准 75 个令牌会将提示大小限制从 75 增加到 150。键入过去会进一步增加提示大小。这是通过将提示分解成 75 个令牌的块来完成的,使用 CLIP 的 Transformers 神经网络独立处理每个标记,然后将结果连接起来,然后再输入稳定扩散的下一个组件 Unet。

For example, a prompt with 120 tokens would be separated into two chunks: first with 75 tokens, second with 45. Both would be padded to 75 tokens and extended with start/end tokens to 77. After passing those two chunks though CLIP, we'll have two tensors with shape of (1, 77, 768). Concatenating those results in (1, 154, 768) tensor that is then passed to Unet without issue.
例如,包含 120 个令牌的提示将分为两个块:第一个块包含 75 个标记,第二个块包含 45 个标记。两者都将填充到 75 个令牌,并使用开始/结束令牌扩展到 77。通过 CLIP 传递这两个块后,我们将有两个形状为 (1, 77, 768) 的张量。将这些结果连接到 (1, 154, 768) 张量中,然后将其毫无问题地传递给Unet。

BREAK keyword

Adding a BREAK keyword (must be uppercase) fills the current chunks with padding characters. Adding more text after BREAK text will start a new chunk.
添加 BREAK 关键字(必须为大写)会用填充字符填充当前区块。在 BREAK 文本之后添加更多文本将开始一个新块。

Attention/emphasis 注意/强调

Using () in the prompt increases the model's attention to enclosed words, and [] decreases it. You can combine multiple modifiers:
在提示中使用 () 会增加模型对封闭单词的关注,而 [] 会减少它。您可以组合多个修饰符:

显而易见,对egg加括号会多放鸡蛋,对bacon加括号会多放培根,很好的例子。

Cheat sheet:

•           a (word) - increase attention to word by a factor of 1.1
a (word) - 将对 word 的关注度提高 1.1 倍

•           a ((word)) - increase attention to word by a factor of 1.21 (= 1.1 * 1.1)
a ((word)) - 将对 word 的关注增加 1.21 倍 (= 1.1 * 1.1)

•           a [word] - decrease attention to word by a factor of 1.1
a [word] - 将对 word 的关注减少 1.1 倍

•           a (word:1.5) - increase attention to word by a factor of 1.5
a (word:1.5) - 将对 word 的关注增加 1.5 倍

•           a (word:0.25) - decrease attention to word by a factor of 4 (= 1 / 0.25)
a (word:0.25) - 将对 word 的关注减少 4 倍 (= 1 / 0.25)

•           a \(word\) - use literal () characters in prompt
a \(word\) - 在提示中使用文字 () 字符

With (), a weight can be specified like this: (text:1.4). If the weight is not specified, it is assumed to be 1.1. Specifying weight only works with () not with [].
使用 () ,可以像这样指定权重: (text:1.4) 。如果未指定权重,则假定为 1.1。指定权重仅适用于 () ,不适用于 [] 。

If you want to use any of the literal ()[] characters in the prompt, use the backslash to escape them: anime_\(character\).
如果要在提示中使用任何文字 ()[] 字符,请使用反斜杠对其进行转义: anime_\(character\) 。

On 2022-09-29, a new implementation was added that supports escape characters and numerical weights. A downside of the new implementation is that the old one was not perfect and sometimes ate characters: "a (((farm))), daytime", for example, would become "a farm daytime" without the comma. This behavior is not shared by the new implementation which preserves all text correctly, and this means that your saved seeds may produce different pictures. For now, there is an option in settings to use the old implementation.
在 2022-09-29 上,添加了支持转义字符和数字权重的新实现。新实现的一个缺点是旧实现并不完美,有时会吃掉字符:“a((farm)))),白天”,例如,如果没有逗号,就会变成“农场白天”。正确保留所有文本的新实现不会共享此行为,这意味着您保存的种子可能会生成不同的图片。目前,设置中有一个选项可以使用旧实现。

NAI uses my implementation from before 2022-09-29, except they have 1.05 as the multiplier and use {} instead of (). So the conversion applies:
NAI 使用我在 2022-09-29 之前的实现,除了他们有 1.05 作为乘数并使用 {} 而不是 () .因此,转换适用:

•           their {word} = our (word:1.05)
他们的 {word} = 我们的 (word:1.05)

•           their {{word}} = our (word:1.1025)
他们的 {{word}} = 我们的 (word:1.1025)

•           their [word] = our (word:0.952) (0.952 = 1/1.05)
他们的 [word] = 我们的 (word:0.952) (0.952 = 1/1.05)

•           their [[word]] = our (word:0.907) (0.907 = 1/1.05/1.05)
他们的 [[word]] = 我们的 (word:0.907) (0.907 = 1/1.05/1.05)

Loopback 循环绘图

Selecting the loopback script in img2img allows you to automatically feed output image as input for the next batch. Equivalent to saving output image, and replacing the input image with it. Batch count setting controls how many iterations of this you get.
在 img2img 中选择环回脚本允许您自动将输出图像作为下一批的输入。相当于保存输出图像,并用它替换输入图像。批量计数设置控制您获得的迭代次数。

Usually, when doing this, you would choose one of many images for the next iteration yourself, so the usefulness of this feature may be questionable, but I've managed to get some very nice outputs with it that I wasn't able to get otherwise.
通常,在执行此操作时,您会自己选择许多图像中的一个进行下一次迭代,因此此功能的有用性可能值得怀疑,但是我已经设法获得了一些非常好的输出,否则我无法获得。

Example: (cherrypicked result) 示例:(精选结果)

并不是每一个loopback都能这么成功(

Original image by Anonymous user from 4chan. Thank you, Anonymous user.
原始图片来自4chan的匿名用户。谢谢你,匿名用户。

X/Y/Z plot  XYZ绘图

Creates multiple grids of images with varying parameters. X and Y are used as the rows and columns, while the Z grid is used as a batch dimension.
创建具有不同参数的多个图像网格。X 和 Y 用作行和列,而 Z 网格用作批处理维度。

使用XYZplot可以做控制变量法的实验以确定参数效果

Select which parameters should be shared by rows, columns and batch by using X type, Y type and Z Type fields, and input those parameters separated by comma into X/Y/Z values fields. For integer, and floating point numbers, and ranges are supported. Examples:
使用 X 类型、Y 类型和 Z 类型字段选择应按行、列和批处理共享的参数,并将这些参数输入到“X/Y/Z”值字段中。对于整数、浮点数和范围,支持。例子:

•           Simple ranges:

普通范围界定:

-          1-5 = 1, 2, 3, 4, 5

•           Ranges with increment in bracket:

圆括号中带有增量的范围界定:

–           1-5 (+2) = 1, 3, 5
–           10-5 (-3) = 10, 7

–           1-3 (+0.5) = 1, 1.5, 2, 2.5, 3

•           Ranges with the count in square brackets:

方括号中带有分布总数的范围界定:

–           1-10 [5] = 1, 3, 5, 7, 10
–           0.0-1.0 [6] = 0.0, 0.2, 0.4, 0.6, 0.8, 1.0

Prompt S/R提示词搜索/替换

Prompt S/R is one of more difficult to understand modes of operation for X/Y Plot. S/R stands for search/replace, and that's what it does - you input a list of words or phrases, it takes the first from the list and treats it as keyword, and replaces all instances of that keyword with other entries from the list.
提示 S/R 是 X/Y 图更难理解的操作模式之一。S/R 代表搜索/替换,这就是它的作用 - 您输入一个单词或短语列表,它从列表中获取第一个并将其视为关键字,并将该关键字的所有实例替换为列表中的其他条目。

For example, with prompt a man holding an apple, 8k clean, and Prompt S/R an apple, a watermelon, a gun you will get three prompts:
例如,使用提示符 a man holding an apple, 8k clean 和提示符 S/R an apple, a watermelon, a gun 时,将收到三个提示:

•           a man holding an apple, 8k clean

•           a man holding a watermelon, 8k clean

•           a man holding a gun, 8k clean

The list uses the same syntax as a line in a CSV file, so if you want to include commas into your entries you have to put text in quotes and make sure there is no space between quotes and separating commas:
该列表使用与 CSV 文件中的行相同的语法,因此如果要在条目中包含逗号,则必须将文本放在引号中,并确保引号和分隔逗号之间没有空格:

错误与正确情况示例:替换文本中的逗号必须放在引号内,且整个引号内必须没有空格

Prompts from file or textbox 来自文件或文本框的提示

With this script it is possible to create a list of jobs which will be executed sequentially.
使用此脚本,可以创建将按顺序执行的作业列表。

Example input:示例输入

Example output:示例输出

Following parameters are supported:
支持以下参数:

 

Resizing

There are three options for resizing input images in img2img mode:
在img2img模式下,有三个选项可用于调整输入图像的大小:

•           Just resize - simply resizes the source image to the target resolution, resulting in an incorrect aspect ratio
只需调整大小 - 只需将源图像调整为目标分辨率,导致宽高比不正确

•           Crop and resize - resize source image preserving aspect ratio so that entirety of target resolution is occupied by it, and crop parts that stick out
裁剪和调整大小 - 调整源图像保留纵横比的大小,以便整个目标分辨率被它占据,并裁剪突出的部分

•           Resize and fill - resize source image preserving aspect ratio so that it entirely fits target resolution, and fill empty space by rows/columns from the source image
调整大小和填充 - 调整源图像保留纵横比的大小,使其完全适合目标分辨率,并按源图像中的行/列填充空白区域

Example:  示例:

不同重设大小方法与去噪强度下的输入输出示例

Sampling method selection 取样方法选择

Pick out of multiple sampling methods for txt2img:
从 txt2img 的多种采样方法中选择:

采样方法示例

Seed resize同一种子下的重设大小

This function allows you to generate images from known seeds at different resolutions. Normally, when you change resolution, the image changes entirely, even if you keep all other parameters including seed. With seed resizing you specify the resolution of the original image, and the model will very likely produce something looking very similar to it, even at a different resolution. In the example below, the leftmost picture is 512x512, and others are produced with exact same parameters but with larger vertical resolution.
此功能允许您以不同的分辨率从已知种子生成图像。通常,当您更改分辨率时,即使您保留所有其他参数(包括种子),图像也会完全更改。通过调整种子大小,您可以指定原始图像的分辨率,并且模型很可能会产生看起来非常相似的东西,即使在不同的分辨率下也是如此。在下面的示例中,最左边的图片是 512x512,其他图片是使用完全相同的参数生成的,但具有更大的垂直分辨率。

示例

Ancestral samplers are a little worse at this than the rest.
祖先采样器在这方面比其他采样器差一点。

You can find this feature by clicking the "Extra" checkbox near the seed.
您可以通过单击种子附近的“额外”复选框来找到此功能。

Variations变奏

A Variation strength slider and Variation seed field allow you to specify how much the existing picture should be altered to look like a different one. At maximum strength, you will get pictures with the Variation seed, at minimum - pictures with the original Seed (except for when using ancestral samplers).
“变体强度”滑块和“变体”种子字段允许您指定应更改现有图片以使其看起来像其他图片的程度。在最大强度下,您将获得带有变体种子的图片,至少 - 带有原始种子的图片(使用祖先采样器时除外)。

示例

You can find this feature by clicking the "Extra" checkbox near the seed.
您可以通过单击种子附近的“额外”复选框来找到此功能。

Styles提示词风格保存

Press the "Save prompt as style" button to write your current prompt to styles.csv, the file with a collection of styles. A dropbox to the right of the prompt will allow you to choose any style out of previously saved, and automatically append it to your input. To delete a style, manually delete it from styles.csv and restart the program.
按“将提示另存为样式”按钮将当前提示写入样式.csv,即包含样式集合的文件。提示右侧的保管箱将允许您从之前保存的样式中选择任何样式,并自动将其附加到您的输入中。要删除样式,请手动将其从样式中删除.csv然后重新启动程序。

if you use the special string {prompt} in your style, it will substitute anything currently in the prompt into that position, rather than appending the style to your prompt.
如果在样式中使用特殊字符串 {prompt} ,它会将提示中当前的任何内容替换到该位置,而不是将样式附加到提示符中。

Negative prompt负面提示词

Allows you to use another prompt of things the model should avoid when generating the picture. This works by using the negative prompt for unconditional conditioning in the sampling process instead of an empty string.
允许您使用模型在生成图片时应避免的其他提示。这通过在采样过程中使用无条件的负提示而不是空字符串来工作。

Advanced explanation: Negative prompt
高级说明:否定提示

示例

CLIP interrogator  CLIP分析

Originally by: https://github.com/pharmapsychotic/clip-interrogator 原文: https://github.com/pharmapsychotic/clip-interrogator

CLIP interrogator allows you to retrieve the prompt from an image. The prompt won't allow you to reproduce this exact image (and sometimes it won't even be close), but it can be a good start.
CLIP 询问器允许您从图像中检索提示。提示不允许您重现此确切图像(有时它甚至不会接近),但它可能是一个好的开始。

CLIP界面

The first time you run CLIP interrogator it will download a few gigabytes of models.
第一次运行 CLIP 询问器时,它将下载几千兆字节的模型。

CLIP interrogator has two parts: one is a BLIP model that creates a text description from the picture. Other is a CLIP model that will pick few lines relevant to the picture out of a list. By default, there is only one list - a list of artists (from artists.csv). You can add more lists by doing the following:
CLIP询问器分为两部分:一部分是从图片创建文本描述的BLIP模型。另一个是 CLIP 模型,它将从列表中选择与图片相关的几行。默认情况下,只有一个列表 - 艺术家列表(来自 artists.csv )。您可以通过执行以下操作添加更多列表:

•           create interrogate directory in the same place as webui
在与WebUI相同的位置创建 interrogate 目录

•           put text files in it with a relevant description on each line
将文本文件放入其中,每行都有相关说明

For example of what text files to use, see https://github.com/pharmapsychotic/clip-interrogator/tree/main/clip_interrogator/data. In fact, you can just take files from there and use them - just skip artists.txt because you already have a list of artists in artists.csv (or use that too, who's going to stop you). Each file adds one line of text to the final description. If you add ".top3." to filename, for example, flavors.top3.txt, the three most relevant lines from this file will be added to the prompt (other numbers also work).
有关要使用的文本文件的示例,请参阅 https://github.com/pharmapsychotic/clip-interrogator/tree/main/clip_interrogator/data 。事实上,你可以从那里获取文件并使用它们 - 只需跳过艺术家.txt因为你已经在 artists.csv 中有一个艺术家列表(或者也使用它,谁会阻止你)。每个文件在最终说明中添加一行文本。如果在文件名中添加“.top3.”,例如 flavors.top3.txt ,则此文件中最相关的三行将被添加到提示符中(其他数字也可以)。

There are settings relevant to this feature:
有与此功能相关的设置:

•           Interrogate: keep models in VRAM - do not unload Interrogate models from memory after using them. For users with a lot of VRAM.
Interrogate: keep models in VRAM - 使用模型后不要从内存中卸载查询模型。对于拥有大量 VRAM 的用户。

•           Interrogate: use artists from artists.csv - adds artist from artists.csv when interrogating. Can be useful to disable when you have your list of artists in interrogate directory
Interrogate: use artists from artists.csv - 询问时添加来自 artists.csv 的艺术家。当您的艺术家列表位于 interrogate 目录中时,禁用可能很有用

•           Interrogate: num_beams for BLIP - parameter that affects how detailed descriptions from BLIP model are (the first part of generated prompt)
Interrogate: num_beams for BLIP - 影响 BLIP 模型详细描述的参数(生成的提示的第一部分)

•           Interrogate: minimum description length - minimum length for BLIP model's text
Interrogate: minimum description length - BLIP 模型文本的最小长度

•           Interrogate: maximum descripton length - maximum length for BLIP model's text
Interrogate: maximum descripton length - BLIP 模型文本的最大长度

•           Interrogate: maximum number of lines in text file - interrogator will only consider this many first lines in a file. Set to 0, the default is 1500, which is about as much as a 4GB videocard can handle.
Interrogate: maximum number of lines in text file - 询问器只会考虑文件中的这么多第一行。设置为 0,默认值为 1500,大约相当于 4GB 视频卡可以处理的数量。

Prompt editing提示词编辑

提示词编辑示例

Prompt editing allows you to start sampling one picture, but in the middle swap to something else. The base syntax for this is:

提示编辑允许您开始采样一张图片,但在中间切换到其他图片。其基本语法为:

Where from and to are arbitrary texts, and when is a number that defines how late in the sampling cycle should the switch be made. The later it is, the less power the model has to draw the to text in place of from text. If when is a number between 0 and 1, it's a fraction of the number of steps after which to make the switch. If it's an integer greater than zero, it's just the step after which to make the switch.

其中 from 和 to 是任意文本, when 是一个数字,用于定义应在采样周期的后期进行切换。它越晚,模型绘制 to 文本代替 from 文本的能力就越小。如果 when 是介于 0 和 1 之间的数字,则它是进行切换的步骤数的一小部分。如果它是一个大于零的整数,则只是进行切换的步骤。

Nesting one prompt editing inside another does work.
将一个提示编辑嵌套在另一个提示编辑中确实有效。

Additionally:

•           [to:when] - adds to to the prompt after a fixed number of steps (when)
[to:when] - 在固定步数后将 to 添加到提示符中 ( when )

•           [from::when] - removes from from the prompt after a fixed number of steps (when)
[from::when] - 在固定步数后从提示中删除 from ( when )

Example: a [fantasy:cyberpunk:16] landscape 示例: a [fantasy:cyberpunk:16] landscape

•           At start, the model will be drawing a fantasy landscape.
开始时,模型将绘制 a fantasy landscape 。

•           After step 16, it will switch to drawing a cyberpunk landscape, continuing from where it stopped with fantasy.
在第 16 步之后,它将切换到 绘制 a cyberpunk landscape ,从fantasy停止的地方继续。


Here's a more complex example with multiple edits: fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5] (sampler has 100 steps)
下面是一个包含多次编辑的更复杂的示例: fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5] (采样器有 100 个步骤)

•           at start, fantasy landscape with a mountain and an oak in foreground shoddy 

开始时, fantasy landscape with a mountain and an oak in foreground shoddy

•           after step 25, fantasy landscape with a lake and an oak in foreground in background shoddy
步骤 25 后, fantasy landscape with a lake and an oak in foreground in background shoddy

•           after step 50, fantasy landscape with a lake and an oak in foreground in background masterful
步骤 50 后, fantasy landscape with a lake and an oak in foreground in background masterful

•           after step 60, fantasy landscape with a lake and an oak in background masterful
步骤 60 后, fantasy landscape with a lake and an oak in background masterful

•           after step 75, fantasy landscape with a lake and a christmas tree in background masterful
步骤 75 后, fantasy landscape with a lake and a christmas tree in background masterful

The picture at the top was made with the prompt:
顶部的图片是在提示下制作的:

`Official portrait of a smiling world war ii general, [male:female:0.99], cheerful, happy, detailed face, 20th century, highly detailed, cinematic lighting, digital art painting by Greg Rutkowski's
“一位微笑的二战将军的官方肖像,[男性:女性:0.99],开朗,快乐,详细的脸,20世纪,高度详细的电影照明,格雷格·鲁特科夫斯基的数字艺术绘画

And the number 0.99 is replaced with whatever you see in column labels on the image.
数字 0.99 将替换为您在图像上的列标签中看到的任何内容。

The last column in the picture is [male:female:0.0], which essentially means that you are asking the model to draw a female from the start, without starting with a male general, and that is why it looks so different from others.
图片中的最后一列是[male:female:0.0],这本质上意味着你要求模型从一开始就画一个女性,而不是从男性将军开始,这就是为什么它看起来与其他模型如此不同。

Alternating Words替换词

Convenient Syntax for swapping every other step.
方便的语法,用于每隔一步交换一次。

[cow|horse] in a field

 On step 1, prompt is "cow in a field." Step 2 is "horse in a field." Step 3 is "cow in a field" and so on.

在步骤 1 中,提示符是“田野里的牛”。第二步是“田野里的马”。第 3 步是“田野里的牛”等等。

gif示意图


See more advanced example below. On step 8, the chain loops back from "man" to "cow."
请参阅下面的更高级示例。在第8步,链条从“人”循环回“牛”。

[cow|cow|horse|man|siberian tiger|ox|man] in a field

 

Prompt editing was first implemented by Doggettx in this myspace.com post.
提示编辑首先由 Doggettx 在这篇 myspace.com 帖子中实现。

Hires. fix高清修复

A convenience option to partially render your image at a lower resolution, upscale it, and then add details at a high resolution. By default, txt2img makes horrible images at very high resolutions, and this makes it possible to avoid using the small picture's composition. Enabled by checking the "Hires. fix" checkbox on the txt2img page.
一个方便的选项,用于以较低的分辨率部分渲染图像,对其进行放大,然后以高分辨率添加细节。默认情况下,txt2img 以非常高的分辨率制作可怕的图像,这样可以避免使用小图片的构图。通过检查位于txt2img 页面上的“高清修复“复选框。

勾选Hiresfix前(左图)后(右图)的输出差距

Small picture is rendered at whatever resolution you set using width/height sliders. Large picture's dimensions are controlled by three sliders: "Scale by" multiplier (Hires upscale), "Resize width to" and/or "Resize height to" (Hires resize).

小图片以您使用宽度/高度滑块设置的任何分辨率呈现。大图片的尺寸由三个滑块控制:“缩放”乘数(雇用高档)、“将宽度调整为”和/或“将高度调整为”(雇用调整大小)。

•           If "Resize width to" and "Resize height to" are 0, "Scale by" is used.
如果“将宽度调整为”和“将高度调整为”为 0,则使用“缩放依据”。

•           If "Resize width to" is 0, "Resize height to" is calculated from width and height.
如果“将宽度调整为”为 0,则根据宽度和高度计算“将高度调整为”。

•           If "Resize height to" is 0, "Resize width to" is calculated from width and height.
如果“将高度调整为”为 0,则根据宽度和高度计算“将宽度调整为”。

•           If both "Resize width to" and "Resize height to" are non-zero, image is upscaled to be at least those dimensions, and some parts are cropped.
如果“将宽度调整为”和“将高度调整为”都不为零,则图像将至少放大为这些尺寸,并且某些部分将被裁剪。

Upscalers放大器

这个我也没看懂干嘛的

A dropdown allows you to to select the kind of upscaler to use for resizing the image. In addition to all upscalers you have available on extras tab, there is an option to upscale a latent space image, which is what stable diffusion works with internally - for a 3x512x512 RGB image, its latent space representation would be 4x64x64. To see what each latent space upscaler does, you can set Denoising strength to 0 and Hires steps to 1 - you'll get a very good approximation of that stable diffusion would be working with on upscaled image.
下拉列表允许您选择要用于调整图像大小的升频器类型。除了您在 extras 选项卡上提供的所有升频器之外,还有一个选项可以放大潜在空间图像,这是稳定扩散在内部使用的功能 - 对于 3x512x512 RGB 图像,其潜在空间表示为 4x64x64。要查看每个潜在空间升频器的作用,您可以将降噪强度设置为 0,将 Hires 步长设置为 1 - 您将获得一个非常好的近似值,即在放大图像上使用的稳定扩散。

Below are examples of how different latent upscale modes look.
以下是不同潜空间放大模式的示例。

Original

原图
不同潜空间放大器的效果

Antialiased variations were PRd in by a contributor and seem to be the same as non-antialiased.

抗锯齿变体由贡献者 PRd 加入,似乎与非抗锯齿变体相同。

Composable Diffusion 可组合的扩散绘图

A method to allow the combination of multiple prompts. combine prompts using an uppercase AND
允许组合多个提示的方法。使用大写 AND 组合提示

Supports weights for prompts: a cat :1.2 AND a dog AND a penguin :2.2 The default weight value is 1. It can be quite useful for combining multiple embeddings to your result: creature_embedding in the woods:0.7 AND arcane_embedding:0.5 AND glitch_embedding:0.2

支持提示权重: a cat :1.2 AND a dog AND a penguin :2.2 默认权重值为 1。对于将多个嵌入组合到结果中非常有用: creature_embedding in the woods:0.7 AND arcane_embedding:0.5 AND glitch_embedding:0.2

Using a value lower than 0.1 will barely have an effect. a cat AND a dog:0.03 will produce basically the same output as a cat
使用低于 0.1 的值几乎不会产生影响。 a cat AND a dog:0.03 将产生与 a cat 基本相同的输出

This could be handy for generating fine-tuned recursive variations, by continuing to append more prompts to your total. creature_embedding on log AND frog:0.13 AND yellow eyes:0.08
通过继续向总数追加更多提示,这对于生成微调的递归变体可能很方便。 creature_embedding on log AND frog:0.13 AND yellow eyes:0.08

Interrupt中断

Press the Interrupt button to stop current processing.
按中断按钮停止当前处理。

4GB videocard support 4GB显卡支持

Optimizations for GPUs with low VRAM. This should make it possible to generate 512x512 images on videocards with 4GB memory.
针对具有低 VRAM 的 GPU 进行了优化。这应该可以在具有 512GB 内存的显卡上生成 4x4 图像。

--lowvram is a reimplementation of an optimization idea by basujindal. Model is separated into modules, and only one module is kept in GPU memory; when another module needs to run, the previous is removed from GPU memory. The nature of this optimization makes the processing run slower -- about 10 times slower compared to normal operation on my RTX 3090.
--lowvram 是巴苏金达尔优化思想的重新实现。模型被分成模块,GPU内存中只保留一个模块;当另一个模块需要运行时,前一个模块将从 GPU 内存中删除。这种优化的性质使处理运行速度变慢 - 与我的RTX 3090上的正常操作相比,大约慢10倍。

--medvram is another optimization that should reduce VRAM usage significantly by not processing conditional and unconditional denoising in the same batch.
--medvram 是另一个优化,通过不在同一批次中处理条件和无条件去噪,应该会显着减少 VRAM 的使用。

This implementation of optimization does not require any modification to the original Stable Diffusion code.
这种优化实现不需要对原始稳定扩散代码进行任何修改。

Face restoration面部修复

Lets you improve faces in pictures using either GFPGAN or CodeFormer. There is a checkbox in every tab to use face restoration, and also a separate tab that just allows you to use face restoration on any picture, with a slider that controls how visible the effect is. You can choose between the two methods in settings.
允许您使用 GFPGAN 或 CodeFormer 改善图片中的人脸。每个选项卡中都有一个复选框来使用面部修复,还有一个单独的选项卡,只允许您在任何图片上使用面部修复,并带有一个滑块来控制效果的可见程度。您可以在设置中在这两种方法之间进行选择。

不同面部修复方法示例

Checkpoint Merger初级融合炼丹术

Guide generously donated by an anonymous benefactor.
由一位匿名捐助者慷慨捐赠的指南。

Great Guide

Full guide with other info is here: https://imgur.com/a/VjFi5uM
包含其他信息的完整指南在这里: https://imgur.com/a/VjFi5uM

Saving储存

Click the Save button under the output section, and generated images will be saved to a directory specified in settings; generation parameters will be appended to a csv file in the same directory.
点击 保存 输出部分下方的按钮,生成的图像将保存到设置中指定的目录中;生成参数将附加到同一目录中的 CSV 文件中。

Loading加载

Gradio's loading graphic has a very negative effect on the processing speed of the neural network. My RTX 3090 makes images about 10% faster when the tab with gradio is not active. By default, the UI now hides loading progress animation and replaces it with static "Loading..." text, which achieves the same effect. Use the --no-progressbar-hiding commandline option to revert this and show loading animations.
Gradio的加载图形对神经网络的处理速度有非常负面的影响。我的RTX 3090使图像速度提高约10%,当带有gradio的标签未处于活动状态时。默认情况下,UI 现在隐藏加载进度动画,并将其替换为静态“正在加载...”文本,达到相同的效果。使用 --no-progressbar-hiding 命令行选项还原此设置并显示加载动画。

Prompt validation提示词确认

Stable Diffusion has a limit for input text length. If your prompt is too long, you will get a warning in the text output field, showing which parts of your text were truncated and ignored by the model.
稳定扩散对输入文本长度有限制。如果提示太长,您将在文本输出字段中收到警告,显示模型截断和忽略了文本的哪些部分。

Png info图片信息

Adds information about generation parameters to PNG as a text chunk. You can view this information later using any software that supports viewing PNG chunk info, for example: https://www.nayuki.io/page/png-file-chunk-inspector
将有关生成参数的信息作为文本块添加到 PNG。您可以稍后使用任何支持查看 PNG 区块信息的软件查看此信息,例如: https://www.nayuki.io/page/png-file-chunk-inspector

Settings设置

A tab with settings, allows you to use UI to edit more than half of parameters that previously were commandline. Settings are saved to config.js file. Settings that remain as commandline options are ones that are required at startup.
带有设置的选项卡允许您使用 UI 编辑以前是命令行的一半以上的参数。设置保存到配置文件.js。保留为命令行选项的设置是启动时所需的设置。

Filenames format文件命名格式

The Images filename pattern field in the Settings tab allows customization of generated txt2img and img2img images filenames. This pattern defines the generation parameters you want to include in filenames and their order. The supported tags are:
“设置”选项卡中的 Images filename pattern 字段允许自定义生成的 txt2img 和 img2img 图像文件名。此模式定义要包含在文件名中的生成参数及其顺序。支持的标签包括:

[steps], [cfg], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [datetime], [job_timestamp].

This list will evolve though, with new additions. You can get an up-to-date list of supported tags by hovering your mouse over the "Images filename pattern" label in the UI.
不过,此列表将随着新内容的添加而发展。通过将鼠标悬停在 UI 中的“图像文件名模式”标签上,可以获取受支持标记的最新列表。

Example of a pattern: [seed]-[steps]-[cfg]-[sampler]-[prompt_spaces]
模式示例: [seed]-[steps]-[cfg]-[sampler]-[prompt_spaces]

Note about "prompt" tags: [prompt] will add underscores between the prompt words, while [prompt_spaces] will keep the prompt intact (easier to copy/paste into the UI again). [prompt_words] is a simplified and cleaned-up version of your prompt, already used to generate subdirectories names, with only the words of your prompt (no punctuation).
关于“提示”标签的注意事项: [prompt] 将在提示词之间添加下划线,而 [prompt_spaces] 将保持提示不变(更容易再次复制/粘贴到 UI 中)。 [prompt_words] 是提示的简化和清理版本,已用于生成子目录名称,仅包含提示的单词(无标点符号)。

If you leave this field empty, the default pattern will be applied ([seed]-[prompt_spaces]).
如果将此字段留空,则将应用默认模式 ( [seed]-[prompt_spaces] )。

Please note that the tags are actually replaced inside the pattern. It means that you can also add non-tags words to this pattern, to make filenames even more explicit. For example: s=[seed],p=[prompt_spaces]
请注意,标签实际上是在图案内替换的。这意味着您还可以在此模式中添加非标记单词,以使文件名更加明确。例如: s=[seed],p=[prompt_spaces]

User scripts用户脚本

If the program is launched with --allow-code option, an extra text input field for script code is available at the bottom of the page, under Scripts -> Custom code. It allows you to input python code that will do the work with the image.
如果使用 --allow-code 选项启动程序,则页面底部的“脚本 ->自定义代码”下会显示脚本代码的额外文本输入字段。它允许您输入将完成图像工作的 python 代码。

In code, access parameters from web UI using the p variable, and provide outputs for web UI using the display(images, seed, info) function. All globals from the script are also accessible.
在代码中,使用 p 变量从 Web UI 访问参数,并使用 display(images, seed, info) 函数为 Web UI 提供输出。脚本中的所有全局变量也可以访问。

A simple script that would just process the image and output it normally:
一个简单的脚本,只需处理图像并正常输出:

UI configUI参数

You can change parameters for UI elements in ui-config.json, it is created automatically when the program first starts. Some options:
您可以在 ui-config.json 中更改 UI 元素的参数,它是在程序首次启动时自动创建的。一些选项:

•           radio groups: default selection 单选组:默认选择

•           sliders: default value, min, max, step
滑块:默认值、最小值、最大值、步长

•           checkboxes: checked state 复选框:选中状态

•           text and number inputs: default values
文本和数字输入:默认值

Checkboxes that would usually expand a hidden section will not initially do so when set as UI config entries.
通常会展开隐藏部分的复选框在设置为 UI 配置条目时最初不会这样做。

ESRGAN

It's possible to use ESRGAN models on the Extras tab, as well as in SD upscale.
可以在“附加内容”选项卡上使用ESRGAN模型,也可以在SD高档中使用。

To use ESRGAN models, put them into ESRGAN directory in the same location as webui.py. A file will be loaded as a model if it has .pth extension. Grab models from the Model Database.
要使用 ESRGAN 模型,请将它们放入与 webui.py 相同位置的 ESRGAN 目录中。如果文件具有 .pth 扩展名,则文件将作为模型加载。从模型数据库中获取模型。

Not all models from the database are supported. All 2x models are most likely not supported.
并非支持数据库中的所有模型。很可能不支持所有 2x 型号。

img2img alternative test 图生图替代测试

这个功能在早期就有,但是我没看懂他和现在的InstructPix2Pix有什么区别

Deconstructs an input image using a reverse of the Euler diffuser to create the noise pattern used to construct the input prompt.
使用欧拉扩散器的反向解构输入图像,以创建用于构造输入提示的噪声模式。

As an example, you can use this image. Select the img2img alternative test from the scripts section.
例如,您可以使用此图像。从脚本部分选择 img2img 替代测试。

Adjust your settings for the reconstruction process:
调整重建过程的设置:

•           Use a brief description of the scene: "A smiling woman with brown hair." Describing features you want to change helps. Set this as your starting prompt, and 'Original Input Prompt' in the script settings.
使用场景的简要描述:“一个棕色头发的微笑女人。描述要更改的功能会有所帮助。将其设置为开始提示,并在脚本设置中设置“原始输入提示”。

•           You MUST use the Euler sampling method, as this script is built on it.
您必须使用欧拉采样方法,因为此脚本是在其上构建的。

•           Sampling steps: 50-60. This MUCH match the decode steps value in the script, or you'll have a bad time. Use 50 for this demo.
采样步骤:50-60。这与脚本中的解码步骤值匹配,否则您将遇到不好的时间。在此演示中使用 50。

•           CFG scale: 2 or lower. For this demo, use 1.8. (Hint, you can edit ui-config.json to change "img2img/CFG Scale/step" to .1 instead of .5.
CFG 量表:2 或更低。对于此演示,请使用 1.8。(提示,您可以编辑 ui-config.json 将“img2img/CFG Scale/step”更改为 .1 而不是 .5。

•           Denoising strength - this does matter, contrary to what the old docs said. Set it to 1.
降噪强度 - 这确实很重要,与旧文档所说的相反。将其设置为 1。

•           Width/Height - Use the width/height of the input image.
宽度/高度 - 使用输入图像的宽度/高度。

•           Seed...you can ignore this. The reverse Euler is generating the noise for the image now.
种子。。。你可以忽略这一点。反向欧拉现在正在为图像产生噪声。

•           Decode cfg scale - Somewhere lower than 1 is the sweet spot. For the demo, use 1.
解码 cfg 刻度 - 低于 1 的地方是最佳点。对于演示,请使用 1。

•           Decode steps - as mentioned above, this should match your sampling steps. 50 for the demo, consider increasing to 60 for more detailed images.
解码步骤 - 如上所述,这应该与您的采样步骤相匹配。演示为 50,对于更详细的图像,请考虑增加到 60。

Once all of the above are dialed in, you should be able to hit "Generate" and get back a result that is a very close approximation to the original.
拨入上述所有内容后,您应该能够点击“生成”并获得与原始结果非常接近的结果。

After validating that the script is re-generating the source photo with a good degree of accuracy, you can try to change the details of the prompt. Larger variations of the original will likely result in an image with an entirely different composition than the source.
验证脚本是否以很高的准确性重新生成源照片后,您可以尝试更改提示的详细信息。原件的较大变化可能会导致图像的构图与源完全不同。

Example outputs using the above settings and prompts below (Red hair/pony not pictured)
使用上述设置和以下提示的示例输出(未显示红发/小马)

不同prompt的输出

"A smiling woman with blue hair." Works. "A frowning woman with brown hair." Works. "A frowning woman with red hair." Works. "A frowning woman with red hair riding a horse." Seems to replace the woman entirely, and now we have a ginger pony.
“一个微笑的蓝头发女人。”工程。“一个皱着眉头的棕色头发的女人。”工程。“一个皱着眉头的红头发女人。”工程。“一个皱着眉头的红头发骑马的女人。”似乎完全取代了女人,现在我们有一匹姜小马。

user.css

Create a file named user.css near webui.py and put custom CSS code into it. For example, this makes the gallery taller:
在 webui.py 附近创建一个名为 user.css 的文件,并将自定义 CSS 代码放入其中。例如,这会使图片展示页面(gallery)更高:

 

A useful tip is you can append /?__theme=dark to your webui url to enable a built in dark theme
一个有用的提示是您可以将 /?__theme=dark 附加到您的webui url以启用内置的深色主题
e.g. (http://127.0.0.1:7860/?__theme=dark) 例如 ( http://127.0.0.1:7860/?__theme=dark )

Alternatively, you can add the --theme=dark to the set COMMANDLINE_ARGS= in webui-user.bat
或者,您可以将 --theme=dark 添加到 @2 中的 set COMMANDLINE_ARGS= #
e.g. set COMMANDLINE_ARGS=--theme=dark 例如 set COMMANDLINE_ARGS=--theme=dark

深色主题

notification.mp3 完成提示音

If an audio file named notification.mp3 is present in webui's root folder, it will be played when the generation process completes.
如果 webui 的根文件夹中存在名为 notification.mp3 的音频文件,它将在生成过程完成后播放。

As a source of inspiration: 作为灵感来源:

•           https://pixabay.com/sound-effects/search/ding/?duration=0-30

•           https://pixabay.com/sound-effects/search/notification/?duration=0-30

Tweaks其他调整

Clip Skip

This is a slider in settings, and it controls how early the processing of prompt by CLIP network should be stopped.
这是设置中的一个滑块,它控制应多早停止 CLIP 网络对提示的处理。

A more detailed explanation: 更详细的解释:

CLIP is a very advanced neural network that transforms your prompt text into a numerical representation. Neural networks work very well with this numerical representation and that's why devs of SD chose CLIP as one of 3 models involved in stable diffusion's method of producing images. As CLIP is a neural network, it means that it has a lot of layers. Your prompt is digitized in a simple way, and then fed through layers. You get numerical representation of the prompt after the 1st layer, you feed that into the second layer, you feed the result of that into third, etc, until you get to the last layer, and that's the output of CLIP that is used in stable diffusion. This is the slider value of 1. But you can stop early, and use the output of the next to last layer - that's slider value of 2. The earlier you stop, the less layers of neural network have worked on the prompt.
CLIP 是一个非常先进的神经网络,可将提示文本转换为数字表示。神经网络与这种数值表示配合得很好,这就是为什么SD的开发人员选择CLIP作为参与稳定扩散生成图像方法的3种模型之一。由于CLIP是一个神经网络,这意味着它有很多层。您的提示以简单的方式数字化,然后通过图层馈送。在第一层之后,你会得到提示的数字表示,你把它输入到第二层,你把结果输入到第三层,依此类推,直到你到达最后一层,这就是用于稳定扩散的CLIP的输出。这是滑块值 1。但是您可以提前停止,并使用倒数第二层的输出 - 即滑块值 2。 越早停止,神经网络在提示上工作的层就越少。

Some models were trained with this kind of tweak, so setting this value helps produce better results on those models.
某些模型是通过这种调整进行训练的,因此设置此值有助于在这些模型上产生更好的结果。

This is the Stable Diffusion web UI wiki. Wiki Home
这是稳定扩散网页UI维基。 维基主页


StableDiffusion绘图【各种特性最全示例】,你的WebUI究竟都能做些什么?的评论 (共 条)

分享到微博请遵守国家法律