mcpField
C
comfyui-prompt-engineer

comfyui-prompt-engineer

github.com/mckruz创意与媒体921.3k 次安装32 周前更新
代码仓库

关于 comfyui-prompt-engineer

comfyui-prompt-engineer 为 ComfyUI 图像与视频生成提供按模型和身份方法定制的提示词指南,适合需要构建正向与负向提示词的创作者。内容涵盖模型规则、参数建议及提示词流程。

主要功能

  1. 01按模型调整提示词结构
  2. 02覆盖 FLUX、SDXL、SD 1.5 与视频模型
  3. 03适配 InstantID、PuLID 和 IP-Adapter FaceID
  4. 04提供负向提示词模板
  5. 05给出提示词构建与检查流程

适用场景

  1. 01为不同模型起草正向和负向提示词
  2. 02使用角色 LoRA 时安排触发词与可变细节
  3. 03为身份方法调整面部描述和 CFG 建议

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mckruz/comfyui-expert --skill comfyui-prompt-engineer

安装后在 Claude Code 中输入/comfyui-prompt-engineer确认已加载。

详细介绍

ComfyUI 提示词工程师

生成针对特定模型和身份方法优化的提示词。不同模型对提示词的响应各不相同。

特定模型的提示词规则

FLUX.1(dev/schnell/Kontext)
  • 风格:自然语言描述效果最佳
  • CFG:3.5-4(非常低)
  • 质量标签:尽量少用——FLUX 不需要「masterpiece, best quality」
  • 长度:中等(50-100 个单词)
  • 结构:{subject description}, {setting}, {lighting}, {camera/style}

FLUX 优质提示词:

photorealistic portrait of a woman with auburn hair and green eyes, freckles across
her nose and cheeks, wearing a cream knit sweater, sitting in a cafe with warm ambient
lighting, shallow depth of field, shot on Sony A7IV, 85mm lens

FLUX 不佳提示词(质量标签过多):

masterpiece, best quality, 8k uhd, highly detailed, photorealistic portrait...
SDXL(RealVisXL、Juggernaut 等)
  • 风格:在开头添加质量标签很有帮助
  • CFG:7-9
  • 质量标签:包含 masterpiece, best quality, photorealistic
  • 长度:中等偏长(50-150 个单词)
  • 结构:{quality tags}, {trigger word}, {subject}, {details}, {setting}, {style}
  • 权重语法:支持 (important:1.3) 或 ((very important))

SDXL 优质提示词:

masterpiece, best quality, sage_character, photorealistic portrait of a woman,
detailed skin texture with freckles, emerald green eyes, auburn copper hair,
natural lighting from window, indoor setting, shallow depth of field,
RAW photo quality, 8k uhd, film grain
SD 1.5
  • 风格:基于标签的方式效果最佳
  • CFG:7-8
  • 质量标签:必不可少
  • 长度:较短(30-80 个单词)
  • 结构:{quality}, {trigger}, {subject}, {details}, {style tags}
Wan 2.1/2.2(视频)
  • 风格:简洁的动作描述
  • CFG:5-7
  • 质量标签:尽量少用
  • 长度:较短(20-50 个单词)
  • 重点:描述动作,而不只是外观
  • 结构:{subject}, {action/motion}, {setting}, {quality}

Wan 优质提示词:

young woman with auburn hair, talking naturally with gentle hand gestures,
seated at a modern desk, soft studio lighting, high quality
AnimateDiff
  • 风格:与基础模型(SD1.5/SDXL)相同,但需添加动作关键词
  • 动作关键词:包含镜头/主体的动作描述
  • 长度:与基础模型相同

搭配身份方法使用

InstantID 提示词

关键调整:

  • 不要描述具体面部特征(模型会提供这些特征)
  • 要描述其他所有内容:服装、姿势、场景、光线
  • CFG 保持在 4-5
photorealistic portrait, wearing black leather jacket, standing in an alley,
dramatic side lighting, urban setting, moody atmosphere, 8k quality
PuLID 提示词

关键调整:

  • 可以包含一些面部描述(PuLID 的容错性更高)
  • 对写实效果使用方法「neutral」,对精确匹配使用「fidelity」
  • CFG 为 5-7
sage_character, photorealistic portrait, green eyes visible, natural makeup,
professional headshot, neutral grey background, studio lighting
IP-Adapter FaceID

关键调整:

  • 描述想要的风格,而不是面部
  • 对 3D→写实使用 weight_type "style transfer"
  • 使用基础模型的标准 CFG
photorealistic portrait, DSLR photo quality, natural skin texture,
warm indoor lighting, bokeh background, professional photography
FLUX Kontext(编辑)

关键调整:

  • 描述要进行的编辑,而不是完整图像
  • 具体说明要更改的内容
  • 说明要保留的内容
Change the outfit to a formal black evening dress while keeping the face,
hair, and pose exactly the same. Add subtle jewelry.
搭配 Character LoRA 使用

关键调整:

  • 始终将触发词放在最前面
  • 不要描述 LoRA 已学会的特征
  • 聚焦于变化的内容:姿势、服装、场景、光线
sage_character, standing on a rooftop at sunset, wind blowing hair,
wearing casual summer dress, city skyline behind, golden hour lighting,
cinematic composition

负面提示词模板

通用负面提示词(SDXL/SD1.5)
(worst quality:1.4), (low quality:1.4), blurry, deformed, bad anatomy,
bad hands, extra fingers, missing fingers, extra limbs, fused fingers,
text, watermark, signature, jpeg artifacts, username, error
写实风格负面提示词
3d render, cartoon, anime, illustration, painting, drawing, cgi,
plastic skin, smooth skin, airbrushed, video game, doll, mannequin,
oversaturated, artificial lighting
视频负面提示词(Wan/AnimateDiff)
static, frozen, jerky motion, low quality, blurry, distorted face,
bad anatomy, glitch, artifacts, flickering, jittery, unnatural movement
FLUX 负面提示词(尽量简短)
blurry, low quality, distorted, deformed, ugly, watermark, text

提示词构建工作流

  1. 从 projects/{project}/characters/{name}/profile.yaml 获取角色资料
  2. 从清单/用户偏好中获取目标模型
  3. 应用上述模型规则
  4. 在适用时添加身份方法修饰项
  5. 使用 LoRA 时包含触发词
  6. 起草正面提示词与负面提示词
  7. 对照角色 generation_history 中以往的成功案例进行检查
  8. 根据方法组合调整 CFG 建议

参考资料

  • references/prompt-templates.md - 完整的模板库和示例
  • references/workflows.md - 各工作流对应的 CFG 和采样器设置
  • projects/ 中的角色资料,包含触发词和特征描述

评论

支持 Markdown