12-AI绘画提示词工程
"AI绘画的提示词不是在'描述'你想要什么,而是在用一种特殊的语言'指导'AI去创作。学会这门语言,你就能画出脑海中的任何画面。"
本章导读
上一章我们学习了Midjourney和Stable Diffusion的使用,但要真正画出想要的图,关键在于提示词(Prompt)的写法。
AI绘画的Prompt和AI写作的Prompt有很大不同。它更像是一种「视觉描述语言」,有自己的语法、词汇和权重规则。
本章将深入AI绘画Prompt的写作技巧:
- 提示词的结构和权重规则
- 完整的风格关键词库
- 光影和氛围的描述方法
- 负向提示词的使用
- 实用的Prompt模板
核心原则
原则一:顺序影响权重,重要的放前面
原则二:具体描述比抽象描述更有效
原则三:风格词决定画面调性
原则四:负向提示词同样重要
一、Prompt的基本规则
1.1 提示词的权重规则
顺序权重:
规则:前面的词权重更高
示例对比:
"a girl with red hair in a garden"
→ 重点在girl
"a garden with a girl with red hair"
→ 重点在garden
建议:把最重要的放最前面
显式权重语法:
| 平台 | 增加权重 | 降低权重 |
|---|---|---|
| Midjourney | (word::1.5) | (word::0.5) |
| SD WebUI | (word:1.5) | (word:0.5) |
| SD WebUI | ((word)) | [word] |
示例(SD WebUI):
(red hair:1.5) → 强调红发
[background:0.5] → 弱化背景
((beautiful eyes)) → 双括号强调
权重范围:0.5 - 2.0
默认权重:1.0
1.2 提示词的分隔
逗号分隔:
每个概念用逗号分隔
正确:
a young woman, long black hair, red dress, smiling, garden
错误(连成一句):
a young woman with long black hair wearing a red dress smiling in a garden
逗号的作用:
├── 明确每个概念
├── 便于调整权重
└── 减少歧义
换行和分组:
可以用换行来分组(视觉上清晰):
【主体】
1girl, solo, long hair, black hair,
【服装】
red dress, off shoulder, jewelry,
【表情动作】
smile, looking at viewer, standing,
【背景】
garden, flowers, sunlight,
【风格】
anime style, detailed, vibrant colors
1.3 提示词长度
不同平台的限制:
| 平台 | 最大长度 | 建议长度 |
|---|---|---|
| Midjourney | ~350词 | 50-150词 |
| SD 1.5 | 75 tokens | 50-75 tokens |
| SDXL | 150 tokens | 80-120 tokens |
长度建议:
太短:信息不足,AI自由发挥太多
太长:后面的词被忽略,可能相互冲突
最佳:足够描述清楚,但不啰嗦
技巧:如果Prompt太长
├── SD可使用BREAK分隔
├── 或使用Prompt插件扩展
└── 删除不必要的词
二、完整的风格关键词库
2.1 艺术风格
传统艺术:
油画:oil painting, oil on canvas, impressionism
水彩:watercolor, watercolor painting, soft watercolor
素描:sketch, pencil drawing, charcoal drawing
水墨:ink painting, Chinese ink wash, sumi-e
版画:woodblock print, linocut, etching
数字艺术:
数字绘画:digital painting, digital art, digital illustration
概念艺术:concept art, conceptual design
插画:illustration, book illustration
矢量:vector art, flat design, minimal illustration
像素:pixel art, 8-bit, 16-bit
摄影风格:
写实摄影:photography, photorealistic, DSLR
肖像:portrait photography, studio portrait
风景:landscape photography, nature photography
商业:commercial photography, product photography
胶片:film photography, analog, Kodak Portra
特定风格:
赛博朋克:cyberpunk, neon, futuristic city
蒸汽朋克:steampunk, Victorian, brass and gears
奇幻:fantasy, magical, ethereal
科幻:sci-fi, science fiction, futuristic
哥特:gothic, dark, mysterious
2.2 画质和细节
质量关键词:
高质量:
best quality, masterpiece, high quality,
highly detailed, ultra detailed, intricate details,
8K, 4K, UHD, high resolution
清晰度:
sharp focus, crisp, clear,
in focus, depth of field
专业性:
professional, award-winning,
trending on artstation, featured on behance
细节控制:
增加细节:
detailed, intricate, elaborate,
fine details, meticulous
简化风格:
simple, minimal, clean,
flat color, limited palette
2.3 光影关键词
自然光:
时间光线:
golden hour → 黄金时刻,温暖
blue hour → 蓝调时刻,冷调
sunrise/sunset → 日出日落
midday sun → 正午阳光
overcast → 阴天,柔光
特殊效果:
dappled light → 斑驳光影
god rays → 丁达尔效果
lens flare → 镜头光晕
sunbeam → 阳光束
人工光:
摄影布光:
studio lighting → 摄影棚布光
soft box → 柔光箱
ring light → 环形灯
three-point lighting → 三点布光
环境光:
neon lights → 霓虹灯
candlelight → 烛光
firelight → 火光
streetlight → 街灯
moonlight → 月光
光影效果:
光影方向:
backlit → 逆光
side lighting → 侧光
rim light → 轮廓光
under lighting → 底光
光影氛围:
dramatic lighting → 戏剧性光影
moody lighting → 情绪光影
high contrast → 高对比
low key → 低调光
high key → 高调光
2.4 色彩关键词
色调控制:
暖色调:
warm colors, warm tones, golden, orange tint
冷色调:
cool colors, cool tones, blue tint, cold
柔和:
soft colors, pastel, muted colors, desaturated
鲜艳:
vibrant, vivid colors, saturated, colorful
单色:
monochrome, black and white, sepia
色彩搭配:
互补色:complementary colors
类似色:analogous colors
三色:triadic colors
限定调色板:limited color palette
特定配色:
blue and orange, pink and blue,
earth tones, jewel tones
2.5 构图关键词
镜头距离:
特写:close-up, extreme close-up, face close-up
半身:portrait, upper body, bust shot
全身:full body, full shot
远景:wide shot, long shot
超远:extreme wide shot, establishing shot
视角:
平视:eye level, straight on
仰视:low angle, from below, worm's eye view
俯视:high angle, from above, bird's eye view
鸟瞰:aerial view, overhead, top-down
倾斜:Dutch angle, tilted
构图法则:
居中:centered, symmetrical composition
三分法:rule of thirds
黄金比例:golden ratio
对称:symmetry, balanced
动态:dynamic composition, diagonal
留白:negative space, minimalist composition
三、负向提示词详解
3.1 负向提示词的作用
负向提示词 = 告诉AI不要生成什么
作用:
├── 避免常见问题(如手部变形)
├── 排除不想要的元素
├── 控制风格边界
└── 提高生成质量
位置:
├── Midjourney:--no [内容]
├── SD:专门的Negative Prompt输入框
└── DALL-E:不支持负向提示词
3.2 通用负向模板
质量类:
low quality, worst quality, normal quality,
lowres, bad anatomy, bad hands,
error, missing fingers, extra digit,
fewer digits, cropped, jpeg artifacts,
signature, watermark, username, blurry,
poorly drawn, disfigured, mutation
人物类:
deformed, ugly, mutilated, disfigured,
bad anatomy, bad proportions,
extra limbs, cloned face, gross proportions,
malformed limbs, missing arms, missing legs,
extra arms, extra legs, fused fingers,
too many fingers, long neck, bad hands
风格排除:
cartoon(排除卡通)
realistic(排除写实,如果要卡通风格)
3d render(排除3D感)
anime(排除动漫风格)
3.3 负向Embedding
常用Embedding:
SD社区常用的负向Embedding:
EasyNegative
├── 综合负向
└── 大幅改善质量
bad-hands-5
├── 专门改善手部
└── 配合其他使用
ng_deepnegative_v1_75t
├── 深度负向
└── 效果显著
badhandv4
├── 手部优化
└── 与bad-hands类似
使用方法:
在负向提示词中输入embedding名称
例如:EasyNegative, bad-hands-5
3.4 针对性负向提示
人物生成优化:
(bad hands:1.4), (bad anatomy:1.4),
(missing fingers:1.4), (extra fingers:1.4),
(deformed face:1.3), (ugly:1.1),
(duplicate:1.2), (morbid:1.2)
写实人像优化:
(CGI:1.3), (3d:1.2), (render:1.2),
(cartoon:1.3), (anime:1.3), (illustration:1.2),
(plastic skin:1.3), (doll:1.2)
二次元优化:
(realistic:1.3), (photorealistic:1.3),
(3d:1.2), (western:1.2),
(bad proportions:1.3)
四、场景化Prompt模板
4.1 人物肖像
写实人像模板:
【正向】
a [年龄] [性别] with [发型发色], [眼睛描述],
[皮肤描述], [表情], wearing [服装],
[姿势], [背景],
portrait photography, natural lighting,
shallow depth of field, 8K, highly detailed
【负向】
EasyNegative, bad-hands-5,
(CGI:1.3), (3d render:1.2), (cartoon:1.2),
(deformed face:1.3), (ugly:1.1)
【参数】
Steps: 25-30
CFG: 7
Sampler: DPM++ 2M Karras
二次元人物模板:
【正向】
1girl, solo, [发色] hair, [发型], [眼睛颜色] eyes,
[表情], [服装描述], [姿势],
[背景], anime style,
detailed, vibrant colors, best quality
【负向】
EasyNegative, (bad hands:1.4),
(realistic:1.3), (3d:1.2),
low quality, worst quality
【参数】
Steps: 20-25
CFG: 7-8
Sampler: DPM++ 2M Karras
4.2 场景风景
自然风景模板:
【正向】
a breathtaking [场景类型] landscape,
[时间] lighting, [天气], [季节],
[前景元素], [中景], [远景],
dramatic sky, [色调],
landscape photography, 8K, HDR,
cinematic, epic scenery
【负向】
人物, 文字, 水印, 低质量
【参数】
比例: 16:9 或 21:9
Steps: 25-30
室内场景模板:
【正向】
a [形容词] [房间类型] interior,
[装修风格] style, [家具描述],
[光线], [色调], [氛围],
interior design photography,
wide angle, detailed, cozy atmosphere
【负向】
people, text, watermark, low quality
【参数】
比例: 16:9 或 4:3
4.3 产品展示
电商产品模板:
【正向】
[产品名称] product photography,
[颜色/材质], on [背景],
studio lighting, soft shadows,
professional, commercial photography,
clean, minimalist, high-end,
8K, highly detailed
【负向】
text, watermark, blurry,
bad lighting, amateur
【参数】
比例: 1:1 或 4:5
背景: 纯色或简单场景
场景化产品模板:
【正向】
[产品] placed on [场景],
lifestyle photography, [光线],
[氛围], natural environment,
commercial, advertising style,
professional, magazine quality
【负向】
studio, white background,
artificial, staged
【参数】
根据产品类型调整
4.4 概念设计
角色设计模板:
【正向】
character concept art, [角色类型],
[服装描述], [武器/道具],
[姿势], full body,
multiple views, front side back,
detailed, fantasy style,
professional character design,
artstation
【负向】
background, scenery,
bad anatomy, low quality
【参数】
比例: 1:1 或 4:3
突出角色设计
场景概念模板:
【正向】
environment concept art, [场景类型],
[建筑风格], [时代],
[光线], [氛围],
epic scale, detailed,
matte painting style,
cinematic, professional
【负向】
people, characters,
low quality, simple
【参数】
比例: 21:9 或 16:9
五、进阶技巧
5.1 Prompt矩阵
什么是Prompt矩阵:
用于批量测试不同变量的组合
语法(SD WebUI):
{选项1|选项2|选项3}
示例:
a girl with {red|blue|green} hair, {smile|serious} face
生成:
├── red hair + smile
├── red hair + serious
├── blue hair + smile
├── blue hair + serious
├── green hair + smile
└── green hair + serious
用途:
├── 测试最佳配色
├── 对比不同风格
└── 批量生成变体
5.2 动态提示词
随机选择:
SD插件支持:
{blue|red|green} → 随机选择一个颜色
{2$$style1|style2|style3} → 随机选择2个
用于:
├── 批量生成多样化内容
├── 探索创意可能性
└── 制作素材库
5.3 区域控制
Latent Couple / Regional Prompter:
允许画面不同区域使用不同Prompt
应用:
├── 左边人物A,右边人物B
├── 前景一个风格,背景另一风格
└── 多角色差异化
需要安装相应插件
5.4 风格混合
混合多种风格:
技巧:用权重控制风格比例
示例:
(oil painting:0.7), (watercolor:0.3)
→ 70%油画感 + 30%水彩感
(anime:0.6), (realistic:0.4)
→ 偏动漫的半写实风格
实验找到最佳比例
六、常见问题解决
6.1 画面问题速查
| 问题 | 可能原因 | 解决方案 |
|---|---|---|
| 手部变形 | AI通病 | 加负向词/隐藏手/后期修复 |
| 人脸崩坏 | 人脸太小/多人 | 放大人脸比例/减少人数 |
| 风格不对 | 风格词不够强 | 增加权重/减少冲突词 |
| 构图混乱 | 描述太复杂 | 简化/分区域生成 |
| 色彩不对 | 没有色彩控制词 | 添加色调关键词 |
| 画面模糊 | 质量词不够 | 添加质量关键词 |
| 不符描述 | Prompt太长/有冲突 | 精简/去除冲突词 |
6.2 调试流程
Prompt调试流程:
1. 简化测试
├── 只保留核心描述
└── 确认基本方向对不对
2. 逐步添加
├── 一次添加一个概念
└── 观察每个词的影响
3. 调整权重
├── 增强想要的
└── 弱化不想要的
4. 优化负向
├── 针对出现的问题
└── 添加对应负向词
5. 微调参数
├── 调整CFG
└── 尝试不同采样器
本章小结
关键认知
1. 提示词顺序影响权重,重要的放前面
2. 逗号分隔每个概念,保持清晰
3. 风格词决定画面调性
4. 光影词影响氛围
5. 负向提示词同样重要
6. 模板是效率工具,要根据需求调整
Prompt检查清单
□ 主体描述是否具体清晰
□ 是否设置了风格关键词
□ 是否添加了光影描述
□ 是否设置了构图/镜头
□ 是否添加了质量词
□ 负向提示词是否完善
□ 权重是否需要调整
□ 是否有冲突的描述
行动清单
- 收集整理自己常用的风格词
- 建立个人的正向/负向提示词库
- 用本章模板生成不同类型的图片
- 练习权重调节,理解其效果
- 整理一套自己的Prompt模板
下一章:13-不同场景的AI绘画应用
掌握了Prompt技巧后,下一章将进入具体的应用场景:自媒体配图、电商图片、设计素材等实际需求如何用AI绘画解决。