Prompt Engineering:AIGC 设计师的核心竞争力
上周,我的学员小王发来一张图,满脸困惑:“老师,我用同样的提示词,为什么Midjourney出图效果和教程里差这么多?”他给我的提示词是:“a beautiful woman in a garden, soft lighting, detailed face”。我问他:“你给AI的‘beautiful’是什么标准?‘garden’是中式园林还是英式花园?‘soft lighting’是黄金时刻还是阴天漫射光?”他愣住了。
这就是大多数设计师在AIGC时代的通病——把提示词当成魔法咒语,而非精确的工程指令。今天,我们就来拆解Prompt Engineering的核心逻辑,让你从“念咒语”进阶为“写代码”。
一、提示词的结构化拆解:从“玄学”到“工程”
1.1 为什么你的提示词总是“薛定谔的出图”?
先看两组对比案例:
无效提示词:
a futuristic city, cyberpunk style, neon lights, rain
有效提示词:
aerial view of a futuristic metropolis at midnight, cyberpunk aesthetic, dense skyscrapers with holographic billboards, wet asphalt reflecting neon signs in cyan and magenta, volumetric fog, cinematic composition, shot on 35mm film, f/2.8, 1/60s, ISO 400 --ar 16:9 --v 6.1 --s 250
差别在哪?有效提示词将“futuristic city”拆解为:视角(aerial view)、时间(midnight)、建筑细节(holographic billboards)、材质(wet asphalt)、色彩系统(cyan and magenta)、光影(volumetric fog)、镜头语言(35mm film, f/2.8)。每一个词都是对AI的一次“精准约束”。
1.2 提示词工程的核心公式
根据我过去2000+小时的实战经验,我将提示词结构总结为:
[主体描述] + [环境/背景] + [光影/色彩] + [风格/艺术家] + [技术参数] + [构图/视角] + [负面提示词]
实操案例:生成一张“蒸汽朋克风格的机械蝴蝶”
步骤1:确定主体
主体:mechanical butterfly
但AI可能理解成“机械蝴蝶”或“蝴蝶形状的机械”。需要细化:
主体:steampunk mechanical butterfly with brass gear wings, copper exoskeleton, clockwork internal structure visible through glass panels
步骤2:叠加环境与光影
环境:floating in a Victorian-era workshop, surrounded by blueprints and brass tools
光影:dramatic side lighting from a gas lamp, deep shadows, warm amber glow
步骤3:注入风格参数
风格:in the style of H.R. Giger meets Jules Verne, illustrated by John Berkey
技术参数:--ar 3:2 --v 6.1 --s 400 --stylize 200
完整提示词:
A steampunk mechanical butterfly with brass gear wings, copper exoskeleton, clockwork internal structure visible through glass panels, floating in a Victorian-era workshop, surrounded by blueprints and brass tools, dramatic side lighting from a gas lamp, deep shadows, warm amber glow, in the style of H.R. Giger meets Jules Verne, illustrated by John Berkey, hyperdetailed, intricate textures, macro photography --ar 3:2 --v 6.1 --s 400 --stylize 200
二、工具链实战:Midjourney v6.1 与 DALL-E 3 的差异化策略
2.1 Midjourney的参数化控制
Midjourney v6.1 是目前对Prompt工程最敏感的工具之一。注意以下关键参数:
| 参数 | 作用 | 推荐范围 |
|——|——|———-|
| `–s` (stylize) | 控制AI的“创作自由度” | 50-1000,写实需求用50-250,艺术化用500-1000 |
| `–ar` | 宽高比 | 16:9, 4:3, 1:1, 9:16 |
| `–v` | 版本号 | 6.1(当前最新) |
| `–no` | 负面提示 | 如 `–no text, watermark, blurry` |
| `–iw` | 图片权重(仅限��图时) | 0.5-2.0 |
实战案例:为游戏角色设计“精灵弓箭手”
第一步:建立视觉锚点
A wood elf archer in a moonlit forest, long silver hair, glowing green eyes, leather armor with leaf motifs, holding a longbow made of ancient oak
第二步:注入光影叙事
Backlit by a full moon, rim lighting on the armor, fireflies floating around, volumetric light rays through trees, cinematic composition
第三步:控制风格强度
--s 300 --ar 16:9 --v 6.1 --no cartoon, anime, realistic photo
第四步:迭代优化
生成后,使用 `Vary (Subtle)` 或 `Vary (Strong)` 进行微调。如果构图不理想,用 `Pan` 功能扩展画面。
2.2 DALL-E 3的自然语言优势
DALL-E 3更擅长理解长文本和复杂指令。它的优势在于“场景叙事”,而非Midjourney的“风格化”。
案例:生成“一个赛博朋克咖啡馆的室内场景”
Midjourney写法(需要高度结构化):
Interior of a cyberpunk cafe, neon signs in Japanese and English, holographic menu boards, patrons with cybernetic implants, rain outside the window, warm amber lighting contrasting with cool blue neon, shot on Fujifilm GFX 100, 23mm lens, f/4 --ar 16:9 --v 6.1
DALL-E 3写法(可以更叙事性):
A bustling cyberpunk cafe interior at night. The walls are covered with flickering neon signs in Japanese and English. Customers sit at metal tables, some with visible cybernetic eye implants. A barista with a robotic arm serves a glowing drink. Outside the large window, rain pours down on neon-lit streets. The lighting is a mix of warm amber from hanging lamps and cool cyan from holographic menu boards. The atmosphere is cozy yet futuristic. Shot with a wide-angle lens, shallow depth of field.
关键差异:
- Midjourney需要明确的摄影参数和风格关键词
三、高级技巧:反向工程与负面提示词
3.1 反向工程:从出图反推提示词
当你看到一张满意的AI作品时,如何复现?使用Midjourney的`/describe`命令:
1. 在Discord中输入 `/describe`
2. 上传参考图
3. 系统返回4个提示词版本
4. 选择最接近的版本,手动调整
实际案例: 我上传了一张“水墨风格赛博朋克”的图,`/describe`返回:
Version 1: A Chinese ink painting style cyberpunk city, black ink splashes on rice paper, neon lights bleeding through wet ink, traditional architecture with holographic elements, minimalist composition
在此基础上,我加入 `–s 600 –v 6.1` 和 `–no color` 得到更纯粹的水墨效果。
3.2 负面提示词:你的“禁止清单”
很多设计师只关注“要什么”,忽略“不要什么”。以Stable Diffusion为例:
常见负面词:
nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, ugly, deformed
针对特定问题的负面词:
实战:生成真实感人物肖像
Prompt: A 35-year-old woman with freckles, natural makeup, messy bun, soft window lighting, candid expression, shot on Canon EOS R5, 85mm f/1.2Negative prompt: plastic skin, smooth skin, airbrushed, instagram filter, beauty mode, perfect teeth, fake eyelashes, heavy makeup, studio lighting, flash photography, overexposed, high contrast
3.3 权重与混合:Stable Diffusion的进阶控制
在Stable Diffusion WebUI (v1.8.0) 中,使用 `()` 和 `[]` 控制权重:
案例:生成“80%写实+20%插画风格”的猫
(realistic cat:1.4), (illustration style:0.6), fluffy orange tabby, green eyes, sitting on a velvet cushion, soft lighting, detailed fur texture
四、总结与进阶建议
4.1 核心要点回顾
1. 结构化思维:将提示词拆解为主体、环境、光影、风格、参数
2. 工具差异化:Midjourney重参数,DALL-E 3重叙事,SD重权重
3. 迭代是常态:没有一次成型的提示词,平均需要3-5轮调整
4. 负面提示词:和正面提示词同等重要
4.2 学习路径建议
新手期(0-2周):
进阶期(2-8周):
专家期(8周+):
最后,记住:Prompt Engineering不是魔法,而是“用AI能理解的语言,精确描述你的视觉想象”。下次当你看到别人惊艳的AI作品时,不要问“这是什么提示词”,而要问“这个提示词的结构是什么,参数怎么设置的”。
—
常见问题 FAQ
Q1:为什么同样的提示词,在不同工具(Midjourney vs DALL-E)效果差异巨大?
A:每个模型训练数据不同,语言理解方式不同。Midjourney更依赖“风格关键词”(如 `cinematic`),DALL-E 3更擅长“叙事描述”(如 `a scene from a noir film`)。建议针对不同工具建立独立的提示词库。
Q2:提示词越长越好吗?
A:不是。Midjourney v6.1 建议控制在100-300个英文单词。过长会导致“注意力稀释”,AI会平均分配权重到每个词上。核心是“精准”而非“多”。
Q3:如何避免AI画出畸形的手指?
A:在负面提示词中加入 `bad hands, missing fingers, extra digit`。同时,在正面提示词中明确 `hands visible, natural hand pose`。如果问题持续,使用Stable Diffusion的ControlNet OpenPose进行手部姿态控制。
Q4:商业项目中,如何保证AI出图的风格一致性?
A:使用Midjourney的 `–cref`(角色参考)和 `–sref`(风格参考)功能。在Stable Diffusion中,训练LoRA模型是最可靠的方案。同时,建立“风格关键词库”,如 `in the style of [艺术家], [材质], [色彩方案]`。
Q5:提示词需要英文写吗?中文提示词行不行?
A:绝大多数模型对英文支持最好(因为训练数据70%以上是英文)。如果你用Midjourney,强烈建议用英文。如果英文不好,可以先用中文构思,再用DeepL或ChatGPT翻译成英文,并让AI优化成“对模型友好的版本”。



评论(0)