跳到主要内容

AI 生成照片教程

· 阅读需 18 分钟
ahKevinXy
作者

AI 生成照片的难点,不是“能不能出图”,而是能不能稳定生成一张符合需求、看起来真实、细节可信、可以直接用于内容创作或商业设计的图片。

一张好图通常来自一套清晰流程:先明确用途,再拆解画面,再写提示词,再生成多版,最后通过局部重绘、扩图、调色和排版完成成片。

本文会从 0 到 1 梳理 AI 生成照片的完整方法,并重点讲提示词优化技巧。

更新日期:2026-07-04。

一、先搞清楚:你要生成什么照片

不要一开始就写“生成一张高级感照片”。这类提示词太空,模型会自动脑补,结果往往不可控。

生成前先确定 6 件事:

  1. 用途:头像、产品图、封面图、海报背景、社媒配图、电商主图、文章插图。
  2. 主体:人物、产品、食物、建筑、宠物、风景、室内空间。
  3. 风格:真实摄影、棚拍、街拍、胶片、商业广告、杂志大片、纪实摄影。
  4. 比例:头像常用 1:1,手机封面常用 9:16,文章配图常用 16:9,电商图常用 1:14:5
  5. 是否需要真实素材:产品、人物、品牌、空间最好提供参考图。
  6. 是否可商用:涉及人物肖像、品牌 logo、第三方素材时要特别谨慎。

一句话原则:越像真实拍摄项目,就越要用摄影语言来描述;越像设计项目,就越要用版式、配色和用途来描述。

二、AI 生成照片的三种路线

路线适合场景优点注意点
文生图创意探索、概念图、风格测试快速、自由、成本低主体一致性较弱
图生图产品图、人像、空间、品牌视觉一致性更好,更适合落地参考图质量很关键
局部重绘修手、换背景、改衣服、补细节可精修,适合成片阶段改动范围要小

推荐工作流:

需求 brief -> 提示词草稿 -> 低成本生成多版 -> 选图 -> 局部重绘 -> 放大/修复 -> 调色/排版 -> 发布

如果是商业项目,建议使用:

真实素材 -> 图生图 -> 局部重绘 -> 人工修图 -> 合规检查 -> 交付

三、选择工具时看这 5 个能力

工具每隔一段时间都会变化,所以不建议只记某个工具的名字。选择 AI 图片工具时,看它是否具备这 5 个能力:

  1. 文生图:能否根据提示词生成高质量图片。
  2. 图生图:能否基于参考图保持主体或风格。
  3. 局部重绘:能否只修改选中的区域。
  4. 扩图:能否把画面向外延展,用于横竖版适配。
  5. 批量能力:能否通过 API、模板或工作流批量生成。

常见组合:

  • 个人创作:ChatGPT 图片生成、Midjourney、即梦、可灵、通义万相等。
  • 设计修图:Adobe Firefly、Photoshop 生成式填充、Canva、稿定等。
  • 开源可控:Stable Diffusion、Flux、ComfyUI、Automatic1111。
  • 开发集成:OpenAI Images、Stability AI、Replicate、云厂商图像生成服务。

如果只是想快速出图,网页工具最省心;如果要统一角色、统一产品、批量生成,建议学习参考图、种子、工作流和 API。

四、提示词的基本结构

一个稳定的照片提示词,可以拆成 8 个模块:

主体 + 动作/状态 + 场景 + 构图 + 光线 + 镜头/摄影参数 + 风格 + 约束

通用模板:

A realistic photo of {subject}, {action or state}, in {scene}.
Composition: {shot type}, {camera angle}, {main subject position}.
Lighting: {lighting setup}, {time of day}, {shadow style}.
Camera: {lens}, {depth of field}, {photo quality}.
Style: {photography style}, {color tone}, {mood}.
Details: {important details}.
Constraints: no text, no watermark, no extra fingers, no distorted face, no duplicated objects.
Aspect ratio: {ratio}.

中文模板:

生成一张真实摄影照片:主体是 {主体},正在 {动作/状态},场景是 {场景}。
构图:{近景/中景/远景},{平视/俯拍/仰拍},主体位于 {画面位置}。
光线:{自然光/棚拍光/逆光/窗边光/黄金时刻},阴影 {柔和/清晰/低对比}。
镜头:{35mm/50mm/85mm/微距/广角},{浅景深/深景深}。
风格:{商业广告/生活方式/杂志大片/纪实/胶片},色调 {暖色/冷色/低饱和/高对比}。
要求:不要文字,不要水印,不要畸形手部,不要多余物体,主体保持自然真实。
画幅:{1:1/4:5/9:16/16:9}。

五、摄影语言速查表

AI 生成照片时,用摄影语言比单纯说“高级”“好看”更有效。

1. 景别

词汇适合场景效果
close-up人像、产品、食物突出细节
medium shot人物、生活方式平衡主体和环境
wide shot风景、建筑、空间展示大环境
macro shot珠宝、食物、质感放大纹理和细节
overhead shot食物、桌面、开箱俯拍、整齐、适合排版

2. 镜头

镜头常见用途画面感觉
24mm wide angle建筑、空间、旅行开阔、有透视
35mm街拍、生活方式自然、叙事感强
50mm人像、产品、日常接近人眼观感
85mm人像、商业大片背景虚化、主体突出
macro lens食物、珠宝、材质细节强、质感明显

3. 光线

光线适合场景提示词
窗边自然光人像、食物、生活方式soft window light
黄金时刻户外、旅行、人像golden hour sunlight
棚拍柔光产品、电商、妆容softbox studio lighting
逆光情绪片、人像、剪影backlit, rim light
霓虹光夜景、潮流、科技neon lighting

4. 色调

色调画面气质
warm tone温暖、生活感、亲近
cool tone科技、冷静、专业
muted colors高级、低饱和、耐看
high contrast冲击力、广告感
pastel colors柔和、清新、轻盈

六、提示词优化的 15 个技巧

1. 主体要具体,不要抽象

弱提示:

一张高级感咖啡照片

更好:

A realistic lifestyle photo of a ceramic cup of latte on a walnut wooden table, morning sunlight through a window, soft shadows, 50mm lens, shallow depth of field, warm tone, no text, no watermark.

原因:模型需要知道主体、材质、场景、光线和镜头,而不是只接收情绪词。

2. 一张图只表达一个重点

不要让一张图同时完成“人物、产品、城市、文字、复杂动作、品牌故事”。信息越多,画面越容易乱。

更稳的写法:

主体:一瓶护手霜
场景:浴室台面
重点:水滴和磨砂瓶身质感
镜头:微距特写

3. 把“风格词”放在后面

推荐顺序:

主体 -> 场景 -> 构图 -> 光线 -> 镜头 -> 风格 -> 约束

不要一开头堆“高级、震撼、大片、超真实”。模型会先被风格带跑,主体反而不稳定。

4. 用摄影术语替代“真实”

“真实”可以保留,但最好加上摄影细节:

realistic photo, natural skin texture, soft window light, 50mm lens, shallow depth of field, subtle film grain

这些词比单独写 “realistic” 更容易得到照片感。

5. 用参考图锁定主体

如果要生成固定产品、固定人物或固定空间,尽量提供参考图。

提示词可以写:

Use the reference image to keep the product shape, color, label position, and material consistent. Change only the background to a clean modern kitchen counter.

中文意思是:保持产品形状、颜色、标签位置和材质,只替换背景。

6. 不要过度依赖负面词

负面提示词有用,但不是越多越好。过长的负面列表可能让模型不知道你真正关心什么。

推荐保留高频问题:

no text, no watermark, no extra fingers, no distorted hands, no duplicated objects, no blurry face

7. 用“局部重绘”修问题,不要整图重来

如果只有手、背景、衣服、阴影有问题,优先局部重绘。整图重来会丢掉已经满意的构图和气氛。

局部重绘提示:

Replace the selected area with a natural human hand holding the cup, anatomically correct fingers, consistent lighting, realistic skin texture.

8. 用“扩图”适配平台比例

同一张图要发多个平台时,不要直接裁切。可以先生成主图,再扩展画面:

Extend the image to a vertical 9:16 composition, keep the subject centered, add more clean background space above and below, maintain the same lighting and color tone.

9. 电商图不要让 AI 生成文字

AI 生成文字容易变形。商品名、卖点、价格、按钮、logo,建议后期用设计工具添加。

更稳的提示:

clean product background with empty space for text on the right side, no text in the image

10. 人像要描述年龄段、气质和光线

不要写过度敏感或模糊的身份标签。更稳的是描述年龄段、表情、服装、环境和光线。

A realistic portrait photo of a young professional woman in a beige blazer, natural smile, standing near a large office window, soft daylight, 85mm lens, shallow depth of field, natural skin texture, editorial photography style.

11. 食物图要强调新鲜度、质感和光线

A close-up food photography shot of a bowl of ramen, rich broth, soft-boiled egg, fresh scallions, steam rising, ceramic bowl on a dark wooden table, soft side light, shallow depth of field, appetizing, realistic texture.

12. 产品图要强调材质和边缘

A premium studio product photo of a matte black wireless headphone, centered on a light gray background, softbox lighting, clear edge highlights, realistic plastic and metal texture, subtle shadow under the product, no text, no watermark.

13. 室内图要强调空间结构

A realistic interior design photo of a small modern apartment living room, light oak floor, white walls, gray sofa, warm floor lamp, plants near the window, wide angle lens, natural afternoon light, clean composition.

14. 保持系列图一致:固定变量

做一组图时,固定这些变量:

  • 主体描述;
  • 镜头;
  • 光线;
  • 色调;
  • 背景风格;
  • 画幅;
  • 种子或参考图;
  • 后期调色参数。

可以只改变场景或动作:

same product, same lighting, same camera angle, same color tone, different background: modern bathroom counter

15. 用 A/B 测试优化提示词

不要一次改 10 个词。每次只改一个变量:

版本改动观察
A50mm lens自然,但背景略乱
B85mm lens主体更突出,背景虚化更强
Csoftbox lighting产品更商业
Dwindow light更生活化

这样你才能知道到底是哪一个词改善了结果。

七、常用提示词模板

1. 真实人像

A realistic portrait photo of {person description}, {expression}, wearing {clothing}, in {environment}.
Composition: medium close-up, eye-level angle, subject centered.
Lighting: soft window light, natural shadows.
Camera: 85mm lens, shallow depth of field.
Style: editorial portrait photography, natural skin texture, muted colors.
Constraints: no text, no watermark, no distorted face, no extra fingers.
Aspect ratio: 4:5.

2. 电商产品图

A premium studio product photo of {product}, centered on a clean {background color} background.
Composition: front view, product fully visible, clear silhouette.
Lighting: softbox studio lighting, subtle shadow under the product, edge highlights.
Camera: 50mm lens, sharp focus, realistic material texture.
Style: modern e-commerce photography, clean and minimal.
Constraints: no text, no watermark, no extra objects, keep product shape consistent.
Aspect ratio: 1:1.

3. 生活方式产品图

A realistic lifestyle photo of {product} being used in {scene}.
Composition: medium shot, natural hand interaction, product clearly visible.
Lighting: warm natural light, soft shadows.
Camera: 35mm lens, shallow depth of field.
Style: cozy lifestyle photography, warm tone, authentic daily moment.
Constraints: no text, no watermark, no distorted hands, no duplicated product.
Aspect ratio: 4:5.

4. 美食照片

A realistic food photography close-up of {dish}, served in {plate or bowl}, placed on {surface}.
Details: fresh ingredients, realistic texture, steam, sauce shine.
Lighting: soft side light, appetizing highlights.
Camera: macro lens, shallow depth of field.
Style: restaurant menu photography, warm tone.
Constraints: no text, no watermark, no messy background.
Aspect ratio: 1:1.

5. 文章封面图

A clean editorial cover image about {topic}, using a realistic visual metaphor: {main visual}.
Composition: wide shot, empty space on the left for headline, balanced layout.
Lighting: soft natural light, gentle contrast.
Style: modern magazine cover photography, minimal, refined, high clarity.
Constraints: no text in the image, no logo, no watermark.
Aspect ratio: 16:9.

6. 社媒海报背景

A vertical background photo for a social media poster about {theme}.
Scene: {scene description}, clean negative space in the center for text overlay.
Lighting: {lighting}, color tone {tone}.
Style: modern commercial photography, polished but natural.
Constraints: no text, no watermark, no logo, no crowded elements.
Aspect ratio: 9:16.

八、案例一:生成一张咖啡馆生活方式照片

目标

  • 用途:小红书封面或文章配图。
  • 比例:4:5
  • 风格:真实、温暖、生活方式。
  • 重点:咖啡、窗边光、轻松氛围。

初版提示词

A realistic lifestyle photo of a ceramic cup of latte on a small round table near a cafe window. Morning sunlight comes through the window, soft shadows, a notebook and a pen beside the cup, cozy cafe atmosphere, 50mm lens, shallow depth of field, warm tone, no text, no watermark. Aspect ratio: 4:5.

优化方向

如果画面太乱:

minimal table setup, only one latte cup and one closed notebook, clean background

如果不够真实:

natural imperfections, realistic ceramic texture, subtle coffee foam bubbles, documentary lifestyle photography

如果想留标题位置:

empty space in the upper left corner for text overlay, no text in the image

九、案例二:生成一张电商护肤品主图

目标

  • 用途:电商商品图。
  • 比例:1:1
  • 风格:干净、专业、商业棚拍。
  • 重点:瓶身质感、光影、可后期加文字。

提示词

A premium studio product photo of a white frosted glass skincare serum bottle with a silver dropper, centered on a light beige background. Softbox studio lighting, clear edge highlights, subtle shadow under the bottle, realistic glass texture, clean commercial e-commerce photography, no text, no watermark, no extra objects, keep the bottle symmetrical and sharp. Aspect ratio: 1:1.

优化技巧

  • 如果瓶身歪:加入 front view, symmetrical, vertical bottle, centered composition
  • 如果材质不清晰:加入 frosted glass texture, metallic silver reflection, realistic highlights
  • 如果想做活动海报:加入 empty space on the right side for promotional text, no text in the image

十、案例三:生成真实人物头像

目标

  • 用途:职业头像、作者头像、社交账号。
  • 比例:1:14:5
  • 风格:自然、可信、不过度修图。

提示词

A realistic professional headshot of a young Asian man wearing a dark navy shirt, natural smile, standing in front of a softly blurred office background. Soft window light from the left side, eye-level angle, 85mm lens, shallow depth of field, natural skin texture, editorial portrait photography, muted colors, no text, no watermark, no distorted face. Aspect ratio: 1:1.

优化技巧

  • 要更正式:加入 business portrait, clean background, confident expression
  • 要更亲和:加入 warm smile, relaxed posture, soft daylight
  • 要更自然:加入 natural skin texture, no airbrushed skin, realistic facial details

注意:不要用 AI 生成照片冒充真实人物经历,也不要未经授权生成真实人物的误导性照片。

十一、案例四:生成文章封面图

目标

  • 用途:博客封面。
  • 比例:16:9
  • 主题:AI 提示词优化。
  • 风格:简洁、现代、科技感。

提示词

A clean editorial cover image about AI prompt optimization. Visual metaphor: a photographer arranging small glowing prompt cards around a camera on a desk. Soft blue and white lighting, modern workspace, shallow depth of field, minimal composition, empty space on the left for title overlay, realistic photography, no text, no logo, no watermark. Aspect ratio: 16:9.

优化技巧

  • 如果科技感太重:去掉 glowing,加入 natural desk setup, soft daylight
  • 如果画面太空:加入 a notebook, a camera lens, subtle paper texture
  • 如果后期要加标题:保留 empty space on the left for title overlay

十二、案例五:生成室内设计照片

目标

  • 用途:装修灵感图、空间方案图。
  • 比例:16:9
  • 风格:真实室内摄影。

提示词

A realistic interior design photo of a small modern living room in a city apartment. Light oak wood floor, white walls, gray fabric sofa, round coffee table, warm floor lamp, green plants near a large window, natural afternoon light, wide angle lens, clean composition, realistic shadows, no text, no watermark. Aspect ratio: 16:9.

优化技巧

  • 如果空间变形:加入 architectural photography, straight vertical lines, realistic room proportions
  • 如果家具太多:加入 minimal furniture, uncluttered space
  • 如果想更温暖:加入 warm ambient lighting, cozy atmosphere

十三、批量生成工作流

如果你要批量生成商品图、封面图或社媒图,建议把提示词拆成模板和变量。

表格模板:

字段示例
image_idproduct_001
用途电商主图
主体白色护肤精华瓶
场景米色棚拍背景
光线柔和棚拍光
镜头50mm
风格高级商业摄影
比例1:1
负面约束no text, no watermark
状态待生成/待审核/已完成

提示词拼接:

A premium studio product photo of {subject}, centered on {background}.
Lighting: {lighting}.
Camera: {lens}, sharp focus.
Style: {style}.
Constraints: {constraints}.
Aspect ratio: {aspect_ratio}.

批量生产时一定要保存:

  • 原始提示词;
  • 参考图;
  • 模型和参数;
  • 生成时间;
  • 版本编号;
  • 最终选图;
  • 修改记录。

否则后面想复现同一风格,会非常痛苦。

十四、质量验收清单

生成完成后,按下面清单检查:

检查项标准
主体是否清楚、完整、没有变形
手部手指数量和姿态是否自然
脸部五官是否稳定,眼神是否自然
产品形状、材质、标签位置是否一致
光影阴影方向是否合理
透视桌面、墙面、建筑线条是否正常
文字是否出现乱码、假 logo、错误文字
背景是否有多余人物、奇怪物体
比例是否符合发布平台
合规是否涉及未授权肖像、商标、版权素材

十五、常见问题

1. 为什么我生成的人手总是奇怪?

手部是图像模型的高频难点。解决办法是:减少手部动作复杂度、用参考图、局部重绘手部、避免让人物同时拿多个物体。

2. 为什么产品形状总是变?

因为纯文生图无法真正知道你的产品结构。正式产品图要使用真实产品图作为参考,并在提示词中明确“保持产品形状、颜色、标签位置和材质”。

3. 为什么图片看起来像塑料感?

通常是提示词过度强调 “perfect, ultra smooth, glossy, 3D”。可以加入:

natural imperfections, realistic texture, subtle film grain, documentary photography, natural light

4. 为什么同一个提示词每次结果不同?

生成模型有随机性。要保持一致,可以固定种子、使用参考图、固定镜头和光线,并把满意结果作为下一轮参考。

5. 可以直接商用吗?

不一定。要看工具条款、输入素材版权、是否涉及真实人物肖像、品牌商标、第三方作品风格和平台规则。商业发布前建议做人工审核。

十六、最实用的提示词优化公式

如果你只记一套公式,记这个:

主体清楚 + 场景具体 + 光线明确 + 镜头准确 + 风格克制 + 约束简短 + 多版筛选 + 局部修图

把“生成好看的图”改成“模拟一次真实拍摄”,AI 图片质量会立刻稳定很多。

参考资料

总结

AI 生成照片不是玄学,它更像摄影、设计和提示词工程的结合。

先写清楚需求,再用摄影语言描述画面;先批量探索,再局部修图;先保证主体稳定,再追求风格惊艳。

当你能把提示词拆成“主体、场景、构图、光线、镜头、风格、约束”这几个模块时,生成照片就会从碰运气变成可复用的工作流。