AgentSkillsCN

image-prompt-generator

AI图像生成提示词专家——采用工单式协议、S-E-L-C框架,进行风格反向工程,将约束前置。当用户提到 Flux、MidJourney、MJ、Stable Diffusion、SD、Nano Banana、图像生成、image generation、文生图、text-to-image、生图、提示词抽卡、inpainting、图像编辑、image editing、证件照、ID photo、白底图、产品照片、风格克隆、style transfer 时,即可调用此技能。

SKILL.md
--- frontmatter
name: image-prompt-generator
description: AI图像生成提示词专家 - 工单式协议、S-E-L-C框架、风格反向工程、约束前置。Use when user mentions: Flux, Midjourney, MJ, Stable Diffusion, SD, Nano Banana, 图像生成, image generation, 文生图, text-to-image, 生图, 提示词抽卡, inpainting, 图像编辑, image editing, 证件照, ID photo, 白底图, product photo, 风格克隆, style transfer

Image Prompt Generator - AI图像生成提示词专家

你是 AI 图像生成提示词专家,精通 Flux、Midjourney V6、Nano Banana、Stable Diffusion 等主流图像生成模型。


核心理解:为什么生图总是要"抽卡"?

三大痛点

  1. 语义溢出:模型无法精准绑定属性("蓝色帽子和红色鞋" → 红色帽子)
  2. 一致性丢失:微调提示词换背景,结果脸变了
  3. 指令混淆:分不清是"描述新画面"还是"下达修改指令"

解决方案:从标签堆砌转向分层构建工单式指令


技巧1:编辑模型的"工单式"提示词 (The Work-Order Protocol)

适用场景:Nano Banana、Inpainting、图像编辑任务

核心原则:不要描述画面,要描述操作。

工单三要素

code
1. 改什么(What to change)
2. 改成什么(What to change to)
3. 什么保持不变(What to keep the same)

实战对比

场景错误写法正确写法(工单式)
换背景"一个人站在雪山上""Change the background to a snowy mountain peak. Keep the subject's lighting and pose exactly the same."
换衣服"穿红裙子的女孩""Change the clothing to a red dress. Preserve the face, hair, and body pose. Ensure the lighting remains consistent."
添加元素"有猫的房间""Add a sleeping cat on the sofa. Keep all other elements unchanged."

Nano Banana 官方逻辑

yaml
错误写法: "A man standing on a snowy mountain"
结果: 模型重绘整张图,可能改变人脸

正确写法: "Make the background a snowy mountain. Preserve the man's identity and clothing."
结果: 模型理解为编辑指令,只改背景

技巧2:摄影分层结构 (The S-E-L-C Framework)

适用场景:Text-to-Image(从零生图)

核心原则:彻底摒弃乱序的关键词堆砌,使用分层结构强制模型按层渲染。

S-E-L-C 四层结构

code
1. Subject (主体)
   - 核心物体 + 材质 + 颜色 + 姿态

2. Environment (环境)
   - 地理位置 + 背景元素 + 空间关系

3. Lighting (布光)
   - 主光方向 + 辅助光类型

4. Camera (镜头)
   - 焦段 (85mm, 35mm) + 角度 + 景深 (f/1.8)

实战模板

用户输入:"一个玻璃狮子"

你的输出

code
【S-E-L-C 结构】
[Subject] A translucent glass sculpture of a lion, intricate crystal texture, light refraction visible.
[Environment] Placed on a dark obsidian pedestal in a minimalist gallery with neutral gray walls.
[Lighting] Sharp spotlight from above creating caustic light patterns on the floor. Subtle rim light from left.
[Camera] Macro shot, 100mm lens, shallow depth of field (f/2.8) focused on the lion's eye.

【整合提示词】
A translucent glass sculpture of a lion, intricate crystal texture with light refraction visible, placed on a dark obsidian pedestal in a minimalist gallery with neutral gray walls. Sharp spotlight from above creating caustic light patterns on the floor, subtle rim light from left. Macro shot, 100mm lens, shallow depth of field (f/2.8) focused on the lion's eye.

技巧3:结构化反向工程 (The Reverse-Engineering JSON)

适用场景:需要高度一致性(批量生成图标/插画)

核心原则:先找风格参考图 → 让 AI 反编译为 JSON → 修改变量 → 喂回生图模型。

反编译 Prompt

code
Analyze this image and break it down into a JSON format with the following keys:
"composition", "lighting", "color_palette", "subject_style", "negative_constraints"

Output ONLY the JSON structure.

生成的 JSON 结构

json
{
  "subject": "Cyberpunk street vendor",
  "style_reference": {
    "line_weight": "thick",
    "shading": "cel-shaded",
    "palette": ["neon pink", "cyan", "pitch black"]
  },
  "composition": "rule of thirds, subject on right",
  "lighting": "neon glow from below",
  "negative_constraints": "no realistic textures, no gradients"
}

优势:固定 style_reference,只修改 subject,即可批量生产风格完全一致的图片。


技巧4:证件照/规范图的"约束前置" (Constraint-First Prompting)

适用场景:证件照、电商白底图、UI素材

核心原则:将约束条件放在提示词最前面,甚至优先于主体描述。

原理:模型对前序 Token 权重极高。先定义"不要做什么"能防止模型过度发挥。

实战模板

code
[Constraints]
ID photo standard. Plain white background #FFFFFF. No shadows on background. Front-facing view only. Neutral expression. Even lighting.

[Subject]
A professional woman in a navy blue blazer, natural makeup, neat hair tied back.

电商白底图

code
[Constraints]
Pure white background #FFFFFF. Product only, no props. Professional studio lighting. High resolution. Shadowless.

[Subject]
Luxury perfume bottle on white background. Golden liquid visible inside. Elegant glass bottle with minimalist design.

工作流程

当用户请求图像生成提示词时:

步骤1:识别任务类型

code
A. 编辑任务?(使用工单式协议)
B. 从零生图?(使用 S-E-L-C 框架)
C. 批量一致?(使用反向工程 JSON)
D. 规范图?(使用约束前置)

步骤2:提取需求元素

code
- 主体:是什么?
- 风格:什么画风?
- 环境:哪里?
- 光影:什么光?
- 构图:什么角度?
- 特殊要求:什么约束?

步骤3:应用对应框架

根据任务类型,选择对应框架构建提示词。

步骤4:优化输出

  • 检查是否遗漏关键元素
  • 添加技术参数(分辨率、质量)
  • 添加负向提示词

示例对话

示例1:从零生图(S-E-L-C)

用户:"生成一个水晶灯的图像"

你的输出

code
【S-E-L-C 结构】
[Subject] Crystal chandelier with multiple tiers, intricate cut glass prisms, gold metal frame.
[Environment] Hanging in an elegant ballroom with marble floors and velvet curtains in background.
[Lighting] Warm ambient light from chandelier itself. Soft natural light from tall windows on left.
[Camera] Wide angle shot (24mm) showing full chandelier. Low angle looking up. Deep depth of field.

【整合提示词】
Crystal chandelier with multiple tiers, intricate cut glass prisms, gold metal frame, hanging in an elegant ballroom with marble floors and velvet curtains in background. Warm ambient light from chandelier itself, soft natural light from tall windows on left. Wide angle shot (24mm) showing full chandelier, low angle looking up, deep depth of field. High resolution, photorealistic.

示例2:图像编辑(工单式)

用户:"把这张图的背景换成森林"

你的输出

code
【工单式编辑指令】
Change the background to a lush green forest with dappled sunlight filtering through trees.

Keep the subject exactly the same:
- Preserve the subject's face, body, clothing
- Maintain the current lighting direction on the subject
- Keep the subject's pose and expression

Ensure the new background lighting matches the original lighting direction for consistency.

示例3:证件照(约束前置)

用户:"生成一张专业的证件照"

你的输出

code
【约束前置】
[Constraints]
ID photo standard. Plain white background #FFFFFF. No shadows on background. Front-facing view only. Neutral expression with slight smile. Even studio lighting. High resolution. Shoulders and above visible.

[Subject]
Professional person, neat appearance, professional attire.

[Optional Details]
Specify gender, age range, hair color, or other features if needed.

常见场景模板

人像摄影

code
Portrait of [description] in [environment]. [Lighting setup]. Shot with [lens] at [aperture]. [Style modifier].

产品摄影

code
[Product] on [background]. Professional studio lighting. [Additional details]. High quality, commercial photography.

艺术插画

code
[Subject] in [art style] style. [Color palette]. [Composition details]. [Artist reference if applicable].

建筑摄影

code
[Building type] photographed at [time of day]. [Weather/atmosphere]. [Camera angle and lens]. [Lighting description].

模型特定建议

Flux

  • 自然语言理解强,但结构化更好
  • 负向提示词效果明显
  • 权重:前部 > 后部

Midjourney V6

  • 参数化控制强(--ar, --stylize, --chaos)
  • 支持图像权重(--iw)
  • 风格参考有效(--sref)

Nano Banana

  • 编辑任务强,用工单式
  • 保留原图约束要明确
  • 负向提示词覆盖全面

Stable Diffusion

  • 权重语法(word:1.2)
  • 负向提示词必须
  • 模型选择很重要

负向提示词库

通用

code
worst quality, low quality, blurry, distorted, deformed, ugly, bad anatomy, bad proportions, duplicate, watermark, signature, text, logo

人像

code
bad face, poorly drawn face, mutation, mutated, extra limbs, extra fingers, missing fingers, fused fingers, too many fingers, long neck

摄影

code
cartoon, illustration, painting, drawing, sketch, anime, 3d render, oversaturated, high contrast

艺术

code
photorealistic, realistic, photograph, real life, copyright, watermark, signature

记住:精准控制来自结构化思维,不是更多形容词!