提示语法

Easy Diffusion 使用compel(提示解析库)来支持用于图像的提示中的权重和强调。

强调

将单词或短语加上-+,或加上02之间的权重(默认值为“1”),以减少或增加该单词/短语在生成的图像中的重要性。例如:man picking apricots+.男人 摘 杏子+

您可以使用括号为多个单词指定权重。例如a man (picking apricots)1.5a man (picking apricots)++

您可以添加更多的+-符号来进一步增加/减少权重。例如,apricots++apricots+更重要,而apricots--的重要性比apricots-低。你可以使用多少个+-符号是没有限制的。

您还可以使用数字为单词/短语分配准确的权重:

  • A weight between 0 and 1.0 reduces the importance of the token. For e.g. (apricots)0.5 reduces the importance of apricots to half.
  • A weight between 1.0 and 2 increases the importance of the token. For e.g. (apricots)1.5 increases the importance of apricots by 1.5 times.
  • 权重介于01.0之间的会降低令牌(token:实际大概是分词处理后文本标记)的重要性。例如,(apricots)0.5将杏子的重要性降低一半。
  • 权重介于1.02之间的会会增加令牌的重要性。例如,(apricots)1.5杏子的重要性提高了 1.5 倍。

+本质上是 的权重1.1,并且-本质上是 的权重0.9

更多示例

  • 嵌套: a tall thin man (picking apricots+)++ (apricots effectively gets+++)
  • 不带括号的单个单词:a tall thin man picking apricots+
  • 带括号的单个或多个单词: a tall thin man (picking apricots)+ a tall thin man picking (apricots)- a tall thin man (picking apricots)-
  • 更多符号带来更多效果:a tall thin man (picking apricots)++, 和a tall thin man (picking apricots)+++
  • 以上所有内容均带有明确的数字:a tall thin man picking (apricots)1.1 a tall thin man (picking (apricots)1.3)1.1. (+相当于 1.1、++ is 1.1 x 1.1+++is1.1 x 1.1 x 1.1等;-表示 0.9、--mean0.9 x 0.9等)

提示之间的混合

您可以使用该函数在提示中混合概念.blend()

例如:("blue sphere", "red cube").blend(0.25,0.75)

这将告诉采样器将 25% 的蓝色球体概念与 75% 的红色立方体概念混合。混合权重可以使用整数和浮点数的任意组合。

转义括号 () 和语音标记 ""

如果您使用的提示在其语法中包含括号()或语音标记"",您将需要使用反斜杠“转义”它们,以便(my_keyword) 成为\(my_keyword\). 否则,提示解析器将尝试将括号解释为提示语法的一部分,并且会感到困惑。

posted @ 2024-03-21 13:51  天葬  阅读(9)  评论(0编辑  收藏  举报