当前位置:AIGC资讯 > AIGC > 正文

【从零开始AI绘画5】StableDiffusionWebUI的clip skip以及ENSD设定

文章目录

clip skip和ENSD clip skip设定为2,ensd设定为31337

clip skip和ENSD

在初期本人并没有设定这两项,只是在不断的学习(copy)别人的提示词后发现,即使使用了相同的参数种子模型却生成不出来和别人相同的图;

后来深入研究发现有两项是没有单独设置过的

This is a slider in settings, and it controls how early the processing of prompt by CLIP network should be stopped.

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.

Some models were trained with this kind of tweak, so setting this value helps produce better results on those models.

Note: All SDXL models are trained with the next to last (penultimate) layer. This is why Clip Skip intentionally does not change the result of the model, as it would simply make the result worse. The option is only provided due to the fact early SDv1 models do not provide any way to determine the correct layer to use.

clip skip设定为2,ensd设定为31337




总结

本文详细介绍了一个在艺术领域中所涉及到的重要环节,关于CLIP skip和ENSD的设置。作者最初在模仿他人使用相同的参数和种子模型时,发现生成的图像结果并不相同。经过深入研究,发现原因在于未单独设置CLIP skip和ENSD两项参数。CLIP skip指的是在处理提示文本通过CLIP神经网络时的早停(early stopping)设定。CLIP是一个先进的神经网络,能将文本提示转化为数值表示,这个数值表示是稳定扩散法(stable diffusion)中生产图像的重要部分。通过设定CLIP skip的值,可以选择使用CLIP神经网络中的哪一层输出来作为稳定扩散的输入。文中建议将CLIP skip设定为2,即使用倒数第二层的输出,这是因为某些模型训练时采用了这样的设定,可以得到更好的生成效果。
ENSD在文中虽然只被简单地提到了数值“31337”,但没有详细的解释。考虑到这可能是一个特定的参数或配置值,其确切意义可能需要进一步了解特定软件或框架的文档或源代码来确认。
综上,本文总结了CLIP skip和ENSD两个参数在图像生成中的重要性,并建议将CLIP skip设定为2以优化生成效果,但对于ENSD的确切含义和作用未进行详细讨论。

更新时间 2024-07-19