1356 字
7 分钟
StableDiffusion:提示词撰写

1. 重要意义#

  • 与AI科学高效沟通的桥梁

提示词意义

2. 使用场景#

2.1 WebUI#

WebUI-提示词

2.2 ComfyUI#

ComfyUI-提示词

3. 包含内容#

​ 为获得一张表现效果较好的图像,需要以丰富多样的方式描述画面内容,主要包括:

  • 作品画风:写实风、水墨风、像素风、厚涂、彩绘……

  • 人物特点:形象、表情、动作、性别、数量……

  • 服饰特点:衣、裤、裙、帽、袜、鞋……

  • 场景内容:室内、室外、校园、草原、海洋、沙漠……

  • 环境光照:白天、傍晚、深夜、清晨、黄昏……

  • 视角设定:拍摄距离、人物比例、观察视角……

    所有内容都可以自由组合、加减权重,以达到期待的图像生成效果。

4. 语法规则#

  1. 提示词必须英文书写

  2. 提示词目前分为词组型语句型两个方案,可以混用

  3. 词组型方案

    • 提示词以词组作为单位,不需要拥有完整且正确的语法结构

    • 词组与词组之间英文半角逗号为分隔符

    • 示例

      苹果,橘子,梨 ✔️ apple, orange, pearPlease draw a picture with a girl walking at the beach. ✔️ a girl, walking, beach

  4. 语句型方案

    • 提示词主要以语句作为单位,也可穿插词组
    • 语句与语句之间英文半角句号为分隔符——更类似于自然语言的表达方式
    • 示例
    The image is a 3D digital art picture. It is in picos style. It describes a young Asian woman sitting on a wooden chair. She is wearing a white collared shirt with a blue and white striped tie and a black skirt. Her long black hair is styled in loose waves and she is looking directly at the camera with a slight smile on her face.

5. 正向提示词#

5.1 特点#

  • 描述画面内容,希望画面里出现什么

5.2 内容型提示词#

  • 主体特征

    • 角色类型:1 girl,1 boy, maid, loli, waitress, doctor,nurse, dancer……
    • 特定人物:megurine luka, hatsune miku, hakurei reimu……
    • 服饰穿搭:white dress, blue skirt, jewelry, blue gemstone, crown, white veil, neck ring……
    • 发型发色:long hair, short hair, white hair, curly hair, bangs, twin braids……
    • 五官特点:small eyes, yellow eyes, one eye closed, big mouth, bunny ears, fox ears……
    • 面部表情:smile, blush, smirk, surprised, tearing up, serious, nervous……
    • 身材特征:muscle, thin, slim, breasts, cleavage, tail……
    • 肢体动作:stretching_arms, holding_hands, crossed_legs, back-to-back, hand in own hair……
  • 场景特征

    • 室内、室外:indoor, outdoor……
    • 场景:forest, city, street, house, caffe house, classroom, shop, on the beach……
    • 细节:trees, bush, flowers, petals, plant, firefly, feather, wooden_ladder……
  • 环境光照

    • 白天黑夜:day, night……
    • 特定时段:morning, sunset, bright, dark……
    • 自然环境:sunlight, light rays, blue sky, starry sky, rainy, cloudy, full_moon, shooting star……
  • 画幅视角

    • 距离:close-up, distant, symmetrical, self_mirror……
    • 人物形体:full body, bust, upper body, lower body, from behind, back, turning around……
    • 观察视角:from above, view of back, looking up,looking down, looking afar,looking away……

5.3 标准化提示词#

  • 画质

    • 通用高画质:best quality, finely detail, masterpiece, wallpaper, checkered……
    • 特定高分辨率类型:Ultra HD, highres, CG Digital rendering, 4K, extremely detailed wallpaper……
  • 画风

    • 插画风:illustrtion, water colour painting, Ukiyoe, pixel art, anime, cartoon, comic……
    • 艺术作品:coil painting, Baroque, folk art, ink painting, pop art, impressionism……
    • 写实系:photorealistic, realistic, photograph……

6. 反向提示词#

6.1 特点#

  • 描述画面内容,希望画面里不要出现什么
  • 可以没有
  • 可以使用通用的标准化提示词

6.2 标准化提示词#

  • 画质:worst quality, low quality, low resolution, normal quality, gray scale……
  • 主体特征:ugly, blurry, duplicate, bad anatomy, bad proportions, missing arms, missing hands, extra fingers, extra legs, bad hands, missing fingers, unclear eyes……

7. 权重设定#

7.1 初阶用法#

  • 括号和数字增强或减弱某些提示词的优先级,建议调整范围:1 ± 0.05
  • 圆括号每套一层括号,权重调整为1.1倍(增强)
    • ((white_flower))——白花权重调整为1.21倍
  • 方括号每套一层括号,权重调整为0.9倍(减弱)
    • [[white_flower]]——白花权重调整为0.81倍
  • 花括号每套一层括号,权重调整1.05倍(增强)
    • {{white_flower}}——白花权重调整为1.1025倍
  • 圆括号+数字括号表示优先级调整,数字表示权重
    • (white_flower:1.5)——白花权重调整为1.5倍
    • (yellow_leaf:0.85)——黄树叶权重调整 为0.85倍

7.2 高阶用法#

  • 混合混合两个描述同一对象的提示词
    • white | yellow flower——生成黄色和白色混合的花
  • 迁移连续生成具有不同特征的对象,不断迁移
    • [white|red|blue] flower——先生成白花,再生成红花,再生成蓝花
  • 迭代:与采样进程关联,一定阶段以后再生成特定对象
    • (white_flower:bush:0.8)——进程达到80%之前生成白花,达到80%之后生成灌木

7.3 注意#

​ 虽然WebUIComfyUI都使用同一套权重书写逻辑,但是ComfyUI的权重调整步长单位是0.05WebUI的权重调整步长单位是0.1——如果将WebUI的提示词原封不动地复制至ComfyUI中,会出现提示词权重过大的问题。

8. 经验分享#

  • 提示词不是一下子就写好的,而是先有一个雏形,再慢慢细化、补充和微调的。
  • 可以先用母语描述想绘画的内容,再翻译成英文,誊写时可以使用建议的提示词。
  • 通过提示词平台的协助,可以更方便地确定提示词。
  • 借鉴其他作者的提示词,按照自己的喜好进行复用或改写。参考平台:AIGodLikecivitaiOpenArt
  • 语法规则将跟随AI技术的提升,逐步向自然语言多语种方向发展,将来撰写提示词工作会变得更加轻松容易
封面
示例歌曲
示例艺术家
封面
示例歌曲
示例艺术家
0:00 / 0:00