🐼 咒语?玄学?Stable Diffusion提示词到底怎么写 prompt语法详解 在SD中用prompt提示词语法 + xyz脚本 实现变脸动画 无需任何插件

氪學家
1 Sept 202311:06

TLDR本期教程深入探讨了Stable Diffusion中prompt提示词的编写技巧,通过实例展示了如何仅用prompt和xyz脚本实现变脸动画,无需插件。讲解了提示词顺序的重要性、逗号的分割作用、关键词权重的手动标记以及指定关键词参与作图的百分比或采样步数。还介绍了如何通过负数排除不喜欢的元素,并通过矩阵试词功能测试不同词的排列组合效果,为观众提供了丰富的SD作图知识。

Takeaways

  • 🎨 The tutorial focuses on understanding and utilizing prompt words effectively in Stable Diffusion (SD) for creating images and animations without plugins.
  • 🌟 The order of words in a prompt significantly affects the output, with different sequences resulting in different images.
  • 📝 Commas are used to separate keywords, and their presence or absence can alter the resulting image.
  • 🔢 Weighting keywords with parentheses and a colon followed by a value can increase their influence on the image generation.
  • 🎯 Holding Ctrl and using the numeric keypad to adjust weights is a quick method to modify keyword influence.
  • 🔄 Specifying the percentage or sampling steps a keyword contributes to the image generation can be done using brackets and a double colon followed by a value.
  • 🚫 Negative values in brackets for sampling steps can eliminate certain elements from the image entirely.
  • 🤹 Using a combination of single and paired keywords with sampling step percentages can create complex image compositions and transitions, such as a transformation or 'face-changing' effect.
  • 🧬 The matrix prompt feature in SD allows for testing various keyword combinations and their impact on image generation by separating them with vertical lines.
  • 📈 The tutorial provides a foundation for understanding prompt syntax and encourages experimentation for achieving desired image outcomes.
  • 📹 The method for creating a stable face-changing animation with SD will be demonstrated in a follow-up video.

Q & A

  • 在Stable Diffusion中,改变提示词的顺序会有什么影响?

    -在Stable Diffusion中,改变提示词的顺序会影响图像的生成结果。不同的词语顺序会导致SD分配给关键词的权重不同,从而产生不同的图像。

  • 逗号在提示词中的作用是什么?

    -逗号在提示词中用于分割关键词,有逗号分割和没有逗号分割的描述会导致不同的图像生成结果。

  • 如何通过手动标记权重的方式给指定的关键词赋权?

    -可以通过将需要赋权的关键词用括号括起来,并在后面加上冒号和需要赋权的数值来进行权重的手动标记。例如,(blue hair):1.5 表示将'blue hair'的权重设为1.5。

  • 在Stable Diffusion中,如何指定关键词参与作图的百分比或采样步数?

    -可以使用方括号来指定关键词参与作图的百分比或采样步数。例如,[blue hair]:0.5 表示'blue hair'这个词参与到做图中的步数是总采样步数的50%。

  • 如果使用小括号代替方括号来指定采样步数,会有什么效果?

    -使用小括号指定采样步数时,如果给到的数值大于1,SD的出图会崩掉。如果数值是0-1之间的小数,SD可以画出图片,且蓝色头发的明显程度会随着百分比的增加而更加明显。

  • 给出的采样步数大于总步数会导致什么结果?

    -如果给出的采样步数大于总步数,最终的出图结果并不会因为步数的增加而变得更复杂,步数超出部分会被忽略。

  • 负数在指定关键词采样步数时有什么作用?

    -给出负数作为采样步数时,可以消除不想出现的元素。例如,将'blue hair'的步数设为负数,会消除所有蓝色的元素。

  • 如何使用Stable Diffusion的矩阵试词功能来测试不同词的排列组合?

    -可以将试验的词用竖线分隔开,并在脚本中选择提示词矩阵的脚本,以实现不同词的排列组合的测试。

  • 在视频中提到的变脸动画是如何实现的?

    -变脸动画是通过分段绘制的语法和指定双词参与作图的步数比例来实现的。通过调整这些数值,可以控制图像生成过程中不同元素的介入时机和占比,从而实现变脸效果。

  • 如何通过提示词排除不喜欢的元素?

    -如果不喜欢某个元素,可以使用赋权方法给予该元素负数的采样步数,从而在图像生成过程中排除该元素。

  • 视频中提到的1 girl, Blue hair, Red hat的矩阵图是如何生成的?

    -通过将这些关键词用竖线分隔,并启用提示词矩阵脚本,可以生成包含所有这些关键词排列组合可能性的矩阵图。

Outlines

00:00

🎨 Introduction to Prompt Techniques in SD Tutorials

This paragraph introduces the viewer to the 25th episode of the SD series tutorials, focusing on the use of prompt words in Stable Diffusion (SD). The creator demonstrates a face-changing animation without any animation plugins, achieved solely through prompt syntax. The video emphasizes the importance of understanding prompt words, even when using controlnet, which is more controllable and intuitive. The creator also mentions their usual approach of copying, modifying, and reflecting on prompt words to achieve satisfactory results.

05:01

📝 Understanding Prompt Syntax and Weighting in SD

This section delves into the intricacies of prompt syntax in SD, explaining how the order of words affects the outcome of generated images. It highlights the impact of comma usage and the ability to manually assign weights to specific keywords using parentheses and colons. The paragraph also introduces the concept of specifying the percentage of steps a word participates in the image generation process using brackets and double colons. Various examples are given to illustrate how these techniques can influence the final image, including the effects of changing the position of keywords and the use of negative values for exclusion.

10:02

🔍 Advanced Prompt Techniques and Matrix Testing

The final paragraph discusses advanced prompt techniques, including the use of parentheses for step control and the concept of negative values to eliminate certain elements from the generated images. It also introduces the matrix prompt feature in SD, which allows for testing various combinations of prompts to see their effects on the generated images. The creator provides an example of how to use this feature and mentions that the tutorial will continue in the next video with a detailed demonstration of creating a face-changing animation using the techniques discussed.

Mindmap

Keywords

💡Stable Diffusion

Stable Diffusion是一种深度学习技术,用于生成图像。在视频中,它被用来通过prompt提示词生成动画效果,无需任何动画插件。这项技术的核心在于通过文本提示来控制图像生成的结果,使得用户能够创造出各种视觉效果。

💡prompt提示词

prompt提示词是用于指导Stable Diffusion生成特定图像的文本输入。这些词语按照一定的顺序和结构排列,能够影响最终生成的图像内容和风格。在视频中,作者详细讲解了如何通过调整提示词的顺序、权重和采样步数来控制图像的生成过程。

💡controlnet

controlnet是一种辅助工具,用于增强Stable Diffusion图像生成的可控性。虽然在视频中提到它不是制作变脸动画的必要条件,但它可以提供更直观的控制方式,帮助用户更精确地实现所需的图像效果。

💡权重

在Stable Diffusion中,权重是一个数值,用来表示某个提示词在图像生成过程中的重要性。通过给提示词赋予不同的权重,用户可以控制图像中各个元素的显著程度。例如,将'blue hair'的权重设为1.5,会增加蓝色头发在图像中的突出程度。

💡采样步数

采样步数是指在Stable Diffusion生成图像的过程中,某个提示词参与到的步骤数量。通过指定采样步数的百分比或具体数值,用户可以控制提示词在图像生成的哪个阶段发挥作用,从而精细调整最终图像的细节和风格。

💡变脸动画

变脸动画是一种视觉效果,通过改变图像中人物的面部特征来模拟面部变化的过程。在视频中,作者通过精心设计的prompt提示词和Stable Diffusion技术,实现了无需任何动画插件的变脸效果,展示了该技术在创作动画方面的潜力。

💡逗号

在Stable Diffusion的prompt提示词中,逗号用于分割不同的关键词或词组,从而影响它们在图像生成中的组合方式。有无逗号分割,最终生成的图像可能会有显著差异。

💡Ctrl键和上下箭头

在视频中,作者介绍了一种快捷的赋权技巧,即通过选中某个词语,按住键盘上的Ctrl键,然后按小键盘上的上下箭头来调整该词语的权重。这种方法提供了一种快速调整提示词权重的手段,使得用户能够更加灵活地控制图像生成的结果。

💡矩阵试词

矩阵试词是Stable Diffusion中的一种功能,允许用户测试多个提示词在图像生成中的不同排列组合。通过这种方法,用户可以观察不同提示词组合对最终图像的影响,从而找到最佳的提示词组合。

💡步数比例

步数比例是指在Stable Diffusion中,指定某个提示词参与图像生成过程的百分比。通过调整步数比例,用户可以控制提示词在整个图像生成过程中的影响力,从而实现更精细的图像控制。

Highlights

本视频是SD系列教程的第25期,专注于讲解prompt提示词的编写技巧。

展示了如何仅使用prompt提示词法和xyz脚本在Stable Diffusion中实现变脸动画,无需任何插件。

为了动画的稳定性,虽然使用了controlnet作为辅助,但这并不是必须的。

提示词的顺序对生成的图像有重要影响,不同的顺序会导致不同的图像结果。

逗号在prompt中的作用是分割关键词,影响最终的图像。

通过手动标记权重的方式,可以给指定的关键词赋权,例如使用括号和冒号。

可以使用Ctrl键和数字键盘的上下箭头给词语赋权,这是一种快捷的操作技巧。

指定关键词参与作图的百分比或采样步数,可以使用方括号和双冒号的语法。

使用小括号而不是中括号,可以控制关键词参与作图的步数,但数值不能大于总步数。

给出的步数如果大于总采样步数,不会使图像更复杂,而是保持不变。

给负数值的采样步数可以消除某些元素在图像中的存在。

通过指定双词参与作图的步数比例,可以实现图像的分段绘制。

SD的矩阵试词功能可以用来测试不同词分别参与作图的效果。

视频最后会演示如何使用这些技巧制作变脸动画,并提供操作注意事项和细节。

通过掌握这些提示词的技巧,每个人都可以制作变脸动画,无需动画插件。

视频旨在帮助观众更好地理解prompt提示词的作用和编写方法。

观众可以通过点赞支持视频,以期待下一期的内容更新。