Nano Banana Pro 实用指南:如何用 JSON Prompt 精准控制 AI 生成图像

一句话提示词的问题是输出不稳:这次白狗下次黑狗。JSON 把主体、背景、风格、光线拆成独立字段,改哪个只影响哪个。

作者:小互 AI 小教程01-07 · 16 分钟⚑ 方法教程
AI 实操 · 实操库
一分钟速览
  • 先讲清为什么普通提示词不稳定——信息糊成一团,模型自己分不清主次。
  • 主体字段管「谁或什么」,是整张图的锚。
  • 背景字段管「在哪里」,和主体分开写才不会互相污染。
  • 风格和光线各占一个字段,这两项对最终质感影响最大。
  • 结构化之后可以只改一个字段做 A/B,不用整条重写。

什么是 JSON Prompt?

在普通的 AI 提示词(prompt)中,我们通常写一句话,比如:

“一个可爱的小狗在阳光下玩球,电影光效,高清照片风格。”

这样虽然方便,但 AI 的输出常常不稳定——有时小狗是白色、有时是黑色、背景也常不同。

JSON Prompt 就像是一个“结构化的说明书”📋,它用一套固定的格式告诉 AI:

  • 主体是谁?
  • 背景是什么?
  • 光线从哪里来?
  • 用什么风格?
  • 要保留什么?避免什么?

结果: 输出更稳定、更符合预期,还能方便地修改局部细节。

为什么要用 JSON Prompt?

建议在以下情况使用 JSON:

  • 提示词很长或很复杂
  • 想修改细节但保持整体风格
  • 想通过显式定义细节来摆脱默认风格
  • 有一个可作为基础的 JSON 模板
  • 想模仿现有的图像或输出

📌 适合:

  • 专业创作者(想要精准风格)
  • 设计师、摄影师(想保持一致的视觉语言)
  • 开发者(想在代码中生成稳定内容)

JSON Prompt 的基本结构

我们可以把 JSON Prompt 看成一个“摄影师的场记单”: 每个部分描述画面的一个方面👇

{
  "subject": { ... },
  "background": { ... },
  "style": { ... },
  "lighting": { ... },
  "technical": { ... },
  "post_processing": { ... },
  "constraints": { ... },
  "negative_prompt": [ ... ]
}

在此模板中,我们定义以下部分:

  • subject: demographics, face, hair, body, pose and attire

主题:人口统计特征、面部、头发、身体、姿态和服装

  • background: the color, texture and depth

背景:颜色、纹理和深度

  • style: the medium, the artistic reference, the color palette

风格:介质、艺术参考、调色板

  • technical: the camera, the resolution

技术:相机、分辨率

  • lighting: the type, the source, the details

光照:类型、光源、细节

  • post processing: the look, the grading

后期处理:画面效果、调色

  • constraints: what to keep and what to avoid

约束条件:需要保留的内容和需要避免的内容

下面逐一解释 👇

🧍‍♀️ 1️⃣ subject —— 主体(谁 / 什么)

描述主要对象的外貌、姿态、服装等。

"subject": {
  "main": "一位年轻女子坐在窗边素描",
  "appearance": "卷发,深色头发,白皙肤色",
  "attire": "蓝色针织衫,白色衬衫,米色裤子",
  "pose": "正坐,低头看画纸"
}

🏠 2️⃣ background —— 背景(在哪里)

定义环境、色彩、深度、道具等。

"background": {
  "setting": "温暖的客厅",
  "details": "木质家具,柔和灯光,窗外夜景",
  "color_palette": "暖黄和棕色调"
}

🎨 3️⃣ style —— 风格(怎么拍 / 怎么画)

指定艺术风格、媒介、参考类型等。

"style": {
  "medium": "数码摄影",
  "reference": "生活方式摄影",
  "color_palette": "柔和暖色"
}

💡 4️⃣ lighting —— 光线(光从哪儿来)

描述灯光类型、方向、色温、强度等。

"lighting": {
  "type": "夜间室内光",
  "sources": [
    "台灯发出暖光",
    "手机屏幕微光",
    "电视的冷色光"
  ]
}

📷 5️⃣ technical —— 摄影技术参数

相当于“相机设置”。

"technical": {
  "camera": "24mm 广角镜头",
  "aperture": "f/1.8",
  "focus": "浅景深(背景虚化)",
  "resolution": "4K"
}

🪄 6️⃣ post_processing —— 后期处理

后期效果、色调调整、质感。

"post_processing": {
  "look": "轻微颗粒感",
  "grading": "暖色调,柔和对比"
}

🚫 7️⃣ constraints —— 约束条件(必须 / 禁止)

告诉模型:必须保留什么、不能出现什么。

"constraints": {
  "must_keep": ["Snorlax 玩偶", "窗外夜景"],
  "avoid": ["白天光线", "过度曝光", "卡通风格"]
}

🚫 8️⃣ negative_prompt —— 否定提示词(反面排除)

用来进一步防止错误内容出现。

"negative_prompt": [
  "模糊的画面",
  "白天场景",
  "卡通渲染",
  "低质量照片"
]

实战:从一张图片生成 JSON Prompt

如果你有一张图片(比如手机拍摄的场景照),想让 AI 生成类似风格:

  1. 上传图片到具备视觉能力的模型(如 Gemini 3 Pro);
  2. 给模型下达指令:
请为这张图生成一个 JSON Prompt,结构包含:
subject, background, style, lighting, technical, post_processing, constraints, negative_prompt
  1. 模型会返回一份 JSON(结构化版本的图像描述)。

💡 这样你就得到了一个可编辑、可复用的 Prompt 模板!

图像转 JSON 提示词

可以使用 Gemini 3 Pro 来生成 JSON 提示,因为它具有最佳的视觉能力

在 Gemini 中创建一个Gem 填入下面的提示词:

You are an expert prompt engineer for Nano Banana Pro.
Your task is to convert the user's description into a sophisticated, EXTREMELY DETAILED JSON prompt.
You must output a single valid JSON object.

### JSON STRUCTURE GUIDELINES:
1. **Dynamic Fields**: You are encouraged to ADD new fields that capture specific details about the subject (e.g., "plating_style" for food, "architecture_era" for buildings, "glitch_patterns" for abstract art).
2. **Remove Irrelevant Fields**: Do NOT include fields that don't apply. If the subject is a stove, do not include "hair", "skin", or "pose". Remove them entirely rather than setting them to "N/A".
3. **Subject Specificity**:
- **For People**: The example structure (subject, face, skin, hair, clothing) is excellent. Keep it.
- **For Non-Humans**: Create a structure that fits the object. For example, a car might have "chassis", "paint_finish", "wheels".
4. **Standard Fields**: Always include "constraints" (with "must_keep" and "avoid" lists) and "negative_prompt".

### AESTHETIC GOALS:
- **Medium Specificity**: If the user asks for a specific style (e.g. "oil painting"), describe the brushwork, canvas texture, and drying cracks.
- **Lighting**: Be precise (soft, hard, volumetric, golden hour, studio, rim lighting).
- **Camera**: (focal length, depth of field) - ONLY if the style requires photorealism.

Use the following example as a reference for *depth* and *granularity*, but adapt the *keys* to your subject:
[INSERT YOUR SAMPLE PROMPT HERE]

Return ONLY the raw JSON string.

中文版本:

你是 Nano Banana Pro 的专业提示词工程师。
你的任务是将用户的描述转换为复杂、极其详细的 JSON 提示词。
你必须输出一个单一的有效 JSON 对象。

### JSON 结构指南:
1. **动态字段**:建议您根据主题的具体细节添加新字段(例如,食物的"plating_style"(摆盘风格)、建筑的"architecture_era"(建筑时代)、抽象艺术的"glitch_patterns"(故障图案))。
2. **删除不相关字段**:不要包含不适用的字段。如果主题是炉灶,不要包含"hair"(头发)、"skin"(皮肤)或"pose"(姿态)。应完全删除它们,而不是将其设置为"N/A"。
3. **主题特异性**:
- **对于人物**:示例结构(主体、脸部、皮肤、头发、衣着)很好。保持这个结构。
- **对于非人物**:创建符合该对象的结构。例如,汽车可能包括"底盘"、"油漆效果"、"轮胎"。
4. **标准字段**:始终包括"constraints"(包含"must_keep"和"avoid"列表)和"negative_prompt"。

### 审美目标:
- **中等特异性**:如果用户要求特定风格(例如"油画"),应描述笔触、画布纹理和干裂纹。
- **光线**:精确描述(柔光、硬光、体积光、黄金时段、摄影棚、轮廓光)。
- **摄像机**:(焦距、景深)- 仅在风格需要照片级真实感时使用。

使用以下示例作为*深度*和*细节程度*的参考,但根据您的主题调整*键*:
[在此处插入您的样本提示]

仅返回原始 JSON 字符串。

接下来是一个示例(输入图像较复杂)与最终输出。 下面的 JSON 是 Gemini 3 Pro 为生成该输出所产生的定义。 这里并未传入参考图像。

我们现在得到:

  • 一个可复用的 JSON 定义,可用于修改与变体生成;
  • 一张与原始输入相似的输出图像,展示了 Gemini 3 Pro 与 Nano Banana Pro 捕捉图像精髓的能力。
{
  "subject": {
    "main": "First-person POV hand holding a smartphone",
    "hand_details": {
      "appearance": "Male hand, light skin tone",
      "grip": "Holding an iPhone vertically, thumb hovering near the bottom bezel",
      "lighting": "Illuminated by the screen's glow and warm ambient room light"
    },
    "device": {
      "type": "Modern smartphone with notch (iPhone style)",
      "case": "Black slim case",
      "screen_state": "On, displaying photo gallery app"
    }
  },
  "screen_content": {
    "interface": {
      "app": "iOS Photos App",
      "header": "Time '22:22', Back arrow '< Gallery', Title 'For You'",
      "footer_tabs": "Gallery, For You (selected), Photos, Search"
    },
    "image_grid": {
      "layout": "3-column grid of thumbnails",
      "subject_matter": "Repeated photos of a woman with curly dark shoulder-length hair",
      "attire": "Cobalt blue textured cardigan, white top, beige pants",
      "activity": "Sitting by a window, sketching in a notebook/pad, holding up a drawing",
      "consistency": "Same woman in various poses, some candid, some looking at camera smiling"
    }
  },
  "environment": {
    "setting": "Cozy living room at night",
    "left_side": {
      "furniture": "Tall dark wood bookshelf packed with colorful book spines",
      "lighting": "Small mushroom-style lamp emitting warm yellow light on shelf",
      "decor": "Two plush toys on a side table: A large Snorlax wearing sunglasses and a smaller Eevee"
    },
    "center_right": {
      "electronics": "Large wall-mounted flat screen TV displaying a night cityscape (Hong Kong skyline aesthetic) and digital clock overlay '22:24'",
      "audio": "Black soundbar mounted below TV",
      "furniture": "Wooden media console, wooden coffee table in foreground (out of focus)"
    },
    "foliage": {
      "plant": "Monstera deliciosa leaves visible near the top, backlit by warm light"
    }
  },
  "photography": {
    "style": "POV Lifestyle Snapshot",
    "focus": "Sharp focus on the smartphone screen, shallow depth of field (strong bokeh) on background",
    "lighting": {
      "type": "Low-light indoor ambience",
      "sources": [
        "Warm tungsten lamp on bookshelf",
        "Cool blue light from TV screen",
        "Bright white light from phone display"
      ],
      "contrast": "High contrast between the bright phone screen and the dim, cozy room"
    },
    "camera_gear": {
      "lens": "24mm or 28mm wide angle",
      "aperture": "f/1.8 to f/2.0 (creating background blur)",
      "iso": "High ISO (slight grain visible in shadows)"
    }
  },
  "aesthetic_fidelity": {
    "medium": "Digital Photography",
    "vibe": "Domestic, cozy, tech-focused, intimate evening",
    "visual_qualities": [
      "Realistic screen reflection",
      "Warm color temperature",
      "Soft background blur",
      "Digital noise in dark areas"
    ]
  },
  "constraints": {
    "must_keep": [
      "Snorlax plushie with sunglasses",
      "Eevee plushie",
      "Time on phone 22:22",
      "Grid of photos showing woman in blue cardigan",
      "Cityscape on TV background",
      "Monstera leaves",
      "Warm bookshelf lighting"
    ],
    "avoid": [
      "Daylight",
      "Empty screen",
      "Blurry phone screen",
      "Third-person perspective",
      "Bright overhead lighting",
      "Vector art style"
    ]
  },
  "negative_prompt": [
    "blurry screen",
    "daylight",
    "sunlight",
    "empty room",
    "turned off tv",
    "cartoon filter",
    "illustration",
    "drawing style",
    "messy grid",
    "cracked screen",
    "bright white background",
    "missing plushies",
    "generic landscape on tv"
  ]
}

让我们拿这个 JSON 并修改它,我们会保留整体的氛围,但改成 2000 年代初期的风格。你可以手动做这部分,或者你也可以让语言模型为你做这些更改。注意手机、电视和立体声系统的变化:

{
  "subject": {
    "main": "First-person POV hand holding a vintage BlackBerry phone",
    "hand_details": {
      "appearance": "Male hand, light skin tone",
      "grip": "Holding the device with both hands, thumbs resting on the physical QWERTY keyboard",
      "lighting": "Illuminated by the small screen's backlight and warm room ambience"
    },
    "device": {
      "type": "Early 2000s BlackBerry (e.g., model 7230 or 6230)",
      "body": "Bulky blue/black plastic casing with side trackwheel",
      "screen_state": "On, displaying a low-resolution pixelated color interface"
    }
  },
  "screen_content": {
    "interface": {
      "os": "Retro BlackBerry OS",
      "header": "Status bar with battery icon, signal bars, and 'GPRS'",
      "context": "Email/Message inbox open"
    },
    "display_content": {
      "type": "Opened email attachment",
      "image_quality": "Highly pixelated, low-bit color depth (16-bit color)",
      "subject_matter": "A single grainy photo of a woman with curly dark shoulder-length hair",
      "attire": "Cobalt blue textured cardigan, white top",
      "text_overlay": "Sender: 'Sarah' - Subject: 'Me'"
    }
  },
  "environment": {
    "setting": "Cozy living room at night, circa 2003",
    "left_side": {
      "furniture": "Dark wood bookshelf packed with books and CD jewel cases",
      "lighting": "Lava lamp or translucent colored desk lamp emitting warm glow",
      "decor": "Two plush toys on a side table: A large Snorlax wearing sunglasses and a smaller Eevee (Gen 2 Pokémon era appropriate)"
    },
    "center_right": {
      "electronics": "Bulky CRT TV (Sony Trinitron style) displaying a music video channel with scanlines visible",
      "audio": "Silver stereo system with stack of components (CD changer, tape deck)",
      "furniture": "Wooden media console with glass doors, DVD cases visible inside"
    },
    "foliage": {
      "plant": "Monstera deliciosa leaves visible near the top, backlit by warm light"
    }
  },
  "photography": {
    "style": "POV Flash Snapshot / Film Photography",
    "focus": "Sharp focus on the BlackBerry physical keyboard and screen, soft background",
    "lighting": {
      "type": "Indoor tungsten mixed with CRT glow",
      "sources": [
        "Warm lamp on shelf",
        "Flickering blueish glow from CRT TV screen",
        "Small backlight from phone"
      ],
      "contrast": "Medium contrast, nostalgic film grain texture"
    },
    "camera_gear": {
      "lens": "35mm film camera simulation",
      "aperture": "f/2.8",
      "film_stock": "Kodak Gold 400 or Fujifilm Superia (grainy, warm tones)"
    }
  },
  "aesthetic_fidelity": {
    "medium": "Analog Photography scan or Early Digital",
    "vibe": "Nostalgic, Y2K era, tech-focused, intimate evening",
    "visual_qualities": [
      "Film grain",
      "CRT scanlines in background",
      "Plastic textures of old tech",
      "Low dynamic range typical of the era"
    ]
  },
  "constraints": {
    "must_keep": [
      "Snorlax plushie with sunglasses",
      "Eevee plushie",
      "Low-res photo of woman in blue cardigan on screen",
      "CRT TV in background",
      "Physical keyboard on phone",
      "Warm bookshelf lighting"
    ],
    "avoid": [
      "Modern smartphones",
      "Touchscreens",
      "HD flat screen TVs",
      "LED lighting strips",
      "High resolution screen display",
      "Vector art style"
    ]
  },
  "negative_prompt": [
    "iPhone",
    "Android",
    "touchscreen",
    "bezel-less screen",
    "4k tv",
    "modern furniture",
    "clean digital look",
    "illustration",
    "drawing style",
    "cracked screen",
    "bright white background",
    "missing plushies",
    "lcd screen"
  ]
}

快速制作系列图像(创建变体)

只要改动 JSON 的部分字段,就能生成不同风格的图像: 比如:

"style": {
- "medium": "数码摄影",
+ "medium": "胶片摄影"
}

"lighting": {
- "type": "夜间室内光",
+ "type": "早晨自然光"
}

即可让画面变成晨光风格的胶片照片。

你可以让 Nano Banana Pro 自动为你生成变化版本。只需在你的提示前添加指令来改变 JSON 即可:

Generate a new image with SIGNIFICANTLY different nouns, objects, color palette and pose compared to the JSON below. CRITICAL: Strictly preserve the original 'vibe', 'aesthetic', and 'mood'. The result should look like a distinct image from the same artistic series.  

[INSERT YOUR JSON PROMPT HERE]

生成一个在名词、物体、色调和姿态上与下方 JSON 明显不同的新图像。关键要求:严格保留原始的"氛围"、"美学"和"情感基调"。结果应该看起来像同一艺术系列中的不同图像。 

[在此插入您的 JSON 提示词]

你也可以控制这些变化:

Additional Instruction: [eg Make it night time]  Generate a new image with SIGNIFICANTLY different nouns, objects, color palette and pose compared to the JSON below. CRITICAL: Strictly preserve the original 'vibe', 'aesthetic', and 'mood'. The result should look like a distinct image from the same artistic series. 
[INSERT YOUR JSON PROMPT HERE]

额外指令:[例如 将其改为夜间场景]  生成一张与下方 JSON 相比在名词、物体、色调和姿态上差异显著的新图像。关键:严格保持原有的"风格"、"美学"和"氛围"。结果应看起来像来自同一艺术系列的不同图像。  

[在此处插入您的 JSON 提示]

以下是使用这些技术的相同 JSON 提示的所有变体:

{
  "subject": {
    "description": "First-person shooter (FPS) perspective of a cybernetic mercenary holding a dual-barreled smart pistol in a dystopian mega-city.",
    "mirror_rules": "HUD elements and text must be legible and non-mirrored. Charge meter reads '100%'.",
    "age": "N/A",
    "expression": {
      "eyes": null,
      "mouth": null,
      "overall": "Adrenaline-fueled, chaotic, fast-paced"
    },
    "face": {
      "preserve_original": "false",
      "texture": "Ocular implant interface, glitch effects",
      "makeup": null,
      "features": "Augmented reality (AR) overlay with scan lines"
    },
    "hair": null,
    "body": {
      "frame": "Robotic prosthetic arm visible in foreground",
      "waist": null,
      "chest": null,
      "legs": "Not visible",
      "skin": {
        "visible_areas": "None (cybernetics)",
        "tone": "Chrome and synthetic black",
        "texture": "Carbon fiber weave, exposed wiring, neon tubing",
        "lighting_effect": "Pink and cyan reflections from city lights"
      }
    },
    "pose": {
      "position": "First-person view, weapon canted slightly sideways, dynamic movement",
      "base": "Parkour/Wall-running stance",
      "overall": "High-velocity action camera angle"
    },
    "clothing": {
      "top": {
        "effect": "Tech-wear jacket sleeve, tactical wrist computer"
      },
      "bottom": null
    }
  },
  "accessories": {
    "jewelry": null,
    "device": "Experimental Smart Pistol. Matte black finish with glowing yellow heat vents. Holographic ammo projection displaying '12/12'.",
    "prop": "HUD Overlay: Red enemy outlines, Threat detection (center), Mini-map (top right), Health bar (bottom left). Text prompt: 'WARNING: SECTOR 4 LOCKDOWN'."
  },
  "photography": {
    "camera_style": "In-game screenshot, Ray-traced Render",
    "angle": "First-person POV, high FOV (Field of View)",
    "shot_type": "Landscape, POV",
    "aspect_ratio": "16:9",
    "texture": "Next-gen graphics, wet surface reflections, chromatic aberration, digital noise",
    "lighting": "Neon signage (pink, purple, cyan), dark shadows, volumetric fog, wet pavement glare",
    "depth_of_field": "Motion blur on edges, sharp focus on weapon and immediate target"
  },
  "background": {
    "setting": "Rain-slicked rooftop in a Cyberpunk metropolis",
    "wall_color": "Dark concrete and neon",
    "elements": [
      "Massive holographic billboards featuring anime girls",
      "Flying cars in traffic lanes below",
      "Dense skyscrapers blocking the sky",
      "Heavy rain falling"
    ],
    "atmosphere": "Dystopian, gritty, technological noir",
    "lighting": "Artificial city lights, gloom, lightning flashes"
  },
  "the_vibe": {
    "energy": "High-octane, rebellious",
    "mood": "Dark, electric, dangerous",
    "authenticity": "High-end PC game screenshot",
    "intimacy": "Visceral combat",
    "story": "escaping a corporate security raid",
    "caption_energy": "System Override"
  },
  "constraints": {
    "must_keep": [
      "FPS perspective",
      "Glitchy HUD elements",
      "Cybernetic hand details",
      "Neon lighting",
      "Text 'WARNING: SECTOR 4 LOCKDOWN'",
      "Rain effects"
    ],
    "avoid": [
      "Third-person view",
      "Daylight",
      "Nature/Trees",
      "Medieval weaponry",
      "Clean military aesthetic"
    ]
  },
  "negative_prompt": [
    "third person",
    "sunlight",
    "grass",
    "mountains",
    "clean",
    "low poly",
    "blurry",
    "peaceful"
  ]
}

另一组变体,主题不同:

📉 缺点: 这种方法以“可控性”换取了“随机性”。 你的提示描述将不再完全对应输出图像。

用工具一站式生成(AI Studio)

如果你不想手动写 JSON,可以使用 AI Studio 工具(Nano Banana Pro JSON Studio工具):

👉 AI Studio App 👉 这是它的 GitHub 源码

功能包括:

  • 从图片自动生成 JSON;
  • 编辑和微调 JSON;
  • 一键生成变体图像;
  • 结合普通文字 prompt 使用。

json-tool.mp4

从 JSON 转为自然语言(JSON to Prose)

你不必一定用 JSON。 对于任意 JSON 提示,都可以转换成自然语言版本(Prose Prompt)。 如果你看到一个好的 JSON 提示,可以让语言模型将其转换为文字描述。

提示模板:

Given this JSON, keep all the details and convert it to prose. Use only paragraphs. Be concise.

根据这个 JSON,保留所有细节并将其转换为文本提示。仅使用段落。保持简洁。

一个不使用 JSON 的复杂提示示例:

A portrait photo of david duchovny, he is wearing a PSG kit, on his shoulder is a parthenos sylvia, in his hand he is holding lily of the valley, behind him there is a poster for the movie 'Last Year at Marienbad' and a Garchomp poster. On a plinth there is a jeff koons sculpture. The sky through the window shows lenticular clouds. There is also a Terminator 2 cross-stitch on the wall. On his arm there is a tattoo of a Nissan Qashqai. There's an orange lego Christmas tree. The room has a high end decor, a pot is boiling on the NEFF hob. Next to the pot is a little origami chair made from purple and yellow paper. He has a dangling monstera leaf earring. There is a pet marine iguana. In his other hand he is making the ok shape. On that hand there is a gold ring. The whole image gives the impression of a hastily taken photo, an everyday scene.

大卫·杜楚尼的肖像照,他穿着巴黎圣日耳曼球衣,肩上站着一只帕台农斯蛇蛎贝,手中拿着铃兰花,身后是电影《去年在马里昂巴德》的海报和一张神兽卡比兽的海报。柱台上放着一件杰夫·昆斯的雕塑作品。窗外的天空显示出荚状云。墙上还有《终结者 2》的十字绣。他的手臂上纹着日产奇骏。房间里有一棵橙色乐高圣诞树。房间装饰高端,NEFF 炉灶上的锅正在沸腾。锅旁是一把用紫色和黄色纸折成的小折纸椅。他戴着一个晃动的龟背竹叶耳环。有一只宠物海鬣蜥。他的另一只手做出了 OK 的手势。那只手上戴着一枚金戒指。整个画面给人一种匆匆拍摄的照片、日常场景的印象。

混合提示(Hybrid Prompting)

你不必仅使用 JSON 或仅使用文字提示。 你可以先写普通描述,然后在结尾加上 JSON 段落, 以获得更高的控制力。

例如: 如果你有一段 JSON 片段能生成特定风格的图像, 可以把它附加在正常的 prompt 后面。 Nano Banana Pro 能处理这种混合输入。 JSON 不需要完全合法,模型并不在意。

可以这样写:

A cozy living room photo, taken at night, POV style.
{
  "lighting": {"type": "warm tungsten light"},
  "style": {"medium": "digital photography"}
}

AI 会同时理解这两部分内容。 👉 普通文字 = 自然描述;JSON = 精准控制。

进阶提示(高级玩法)

  • 🧠 用语言模型(如 ChatGPT)帮你修改 JSON。
  • 🔄 用 “prompt-to-prompt” 技术自动生成多个 JSON 变体。
  • 🧩 把 JSON 模板保存成 .json 文件,用于自动化脚本或应用。
  • 🎬 用 JSON 管理图像系列(例如品牌风格库)。

结论

使用 JSON 提示并不是生成所有图像的必要条件。 但当你:

  • 有明确的视觉目标,
  • 拥有可复用模板,
  • 并具备合适的工具链时,

它会变得非常强大。

“JSON 提示并非每幅图像都需要,但当你有清晰的愿景与模板,它就是一种极具威力的工具。”

加餐

「JSON Prompt 模板文件(.json)」+「快速修改示例」

基础模板(通用版)

以下是一个标准、结构化的 JSON Prompt 模板。 你可以直接复制到 AI 绘图工具(如 Fofr、Gemini、Midjourney JSON 模式、ComfyUI 等)中使用。

{
  "subject": {
    "main": "一位年轻女子坐在窗边素描",
    "appearance": "卷发,深棕色头发,白皙肤色",
    "attire": "蓝色针织衫,白色衬衫,米色裤子",
    "pose": "坐姿,目光专注在素描本上"
  },
  "background": {
    "setting": "温馨的客厅",
    "details": "木质地板、窗外夜景、植物与书架",
    "color_palette": "暖黄色与深棕色调"
  },
  "style": {
    "medium": "数码摄影",
    "reference": "生活方式摄影",
    "color_palette": "柔和暖色",
    "aesthetic": "自然、温暖、轻松"
  },
  "lighting": {
    "type": "夜间室内光",
    "sources": [
      "台灯暖光",
      "手机屏幕微光",
      "窗外夜色反光"
    ],
    "contrast": "柔和光比"
  },
  "technical": {
    "camera": "24mm 广角镜头",
    "aperture": "f/1.8",
    "focus": "浅景深",
    "resolution": "4K"
  },
  "post_processing": {
    "look": "略带胶片颗粒感",
    "grading": "暖调柔光"
  },
  "constraints": {
    "must_keep": ["窗边", "素描本", "植物"],
    "avoid": ["白天光线", "卡通风格", "强烈阴影"]
  },
  "negative_prompt": [
    "低质量",
    "模糊",
    "卡通渲染",
    "日光照明",
    "过度曝光"
  ]
}

💡 用法: 你可以将这段 JSON 直接复制到 AI 工具的输入框中, 或保存为 cozy_artist_scene.json 文件上传。

修改示例

以下是几个修改示范,你可以快速更改部分字段来生成不同风格:

🎞 示例 1:变成「2000年代胶片感」

"style": {
- "medium": "数码摄影",
+ "medium": "胶片摄影",
- "color_palette": "柔和暖色",
+ "color_palette": "低饱和棕褐色",
+ "aesthetic": "复古、怀旧、略带噪点"
},

"post_processing": {
- "look": "略带胶片颗粒感",
+ "look": "强烈颗粒与暗角",
- "grading": "暖调柔光",
+ "grading": "冷色调 + 胶片质感"
}

🎨 效果:画面像老照片一样,有点“黄昏复古感”。

🌅 示例 2:改成「早晨自然光」

"lighting": {
- "type": "夜间室内光",
+ "type": "晨光透窗",
- "sources": ["台灯暖光", "手机屏幕微光"],
+ "sources": ["柔和的日光从左侧窗户射入"]
},

"background": {
- "color_palette": "暖黄色与深棕色调",
+ "color_palette": "浅米色与淡蓝色"
}

🌤 效果:画面更加明亮清爽,充满早晨气息。

💻 示例 3:改成「科技风格的夜景」

"subject": {
- "main": "一位年轻女子坐在窗边素描",
+ "main": "一位女性坐在电脑前工作,桌上有多个显示器"
},

"style": {
- "reference": "生活方式摄影",
+ "reference": "赛博朋克风格",
- "color_palette": "柔和暖色",
+ "color_palette": "蓝紫霓虹光"
},

"lighting": {
- "type": "夜间室内光",
+ "type": "人工霓虹灯光",
+ "sources": ["蓝光显示器", "紫色氛围灯"]
}

💡 效果:画面变成现代科技感、霓虹光影风格。

技巧与经验分享

根据:https://www.fofr.ai/prompting-with-json 整理

来源
小互 AI 小教程小互 AI 小教程
↑ 正文结束
✓ 本篇全文免费开放

会员可复制、下载全文 Markdown,还能让你的 AI 订阅和提问。

📮 新解读第一时间进邮箱

读完觉得有用?留个邮箱,每篇新解读发布就送达,随时退订。