为Nano Banana编写JSON提示
如果您使用的是 Gemini Nano Banana,您的结果很大程度上取决于您如何编写提示。
大多数人只是输入一长串描述,然后希望获得最佳效果。
但有一种更智能的方法:JSON 提示。
为什么选择 JSON?因为它简洁。
它将您的想法组织成小方框。
您无需将所有内容都堆放在一行复杂的代码中,而是将其拆分开来。
模型能够更好地理解它,从而获得更清晰、更锐利的图像。
1、从基础开始
JSON 提示符有一个简单的框架:
{
"style": {},
"technical": {},
"materials": {},
"environment": {},
"composition": {},
"quality": {}
}
把它想象成你空的购物车。你会逐一往里面填满细节。
2、风格至上
这很简单:你想要什么样的外观?你想要电影风格、纪录片风格还是照片写实风格?
"style": {
"primary": "photorealistic",
"rendering_quality": "high-resolution",
"lighting": "natural"
}
这句话的意思基本上是:让它看起来真实、清晰、光线自然。
3、添加科技元素
假设你拿着一台相机。景深、光圈、曝光——诸如此类。
"technical": {
"camera_settings": {
"depth_of_field": "shallow",
"focal_length": "85mm",
"aperture": "f/1.8"
},
"resolution": "professional quality"
}
无需过多考虑。只需像照片一样设置即可。
4、材质 = 真实纹理
这部分让物体感觉真实。皮肤有毛孔,织物有缝线,表面有划痕。
"materials": {
"skin": "pores, natural imperfections",
"fabric": "thread patterns, realistic drape"
}
这就是假娃娃脸和真人脸的区别。
5、设置场景
现在为你的图像添加环境。时间、季节、氛围。
"environment": {
"time_season": "autumn sunset",
"atmosphere": "light haze"
}
正是这些细微的点缀让图像有了生命力。
6、别忘了构图
如果你见过构图糟糕的照片,你就会明白为什么构图很重要。
"composition": {
"perspective": "natural human vision",
"framing": "rule of thirds"
}
简单来说,告诉Gemini:不要切掉头部,并遵循摄影基本原则。
7、质量检查
最后一件事——告诉它你想要什么,以及应该避免什么。
"quality": {
"include": ["hyperrealistic", "natural lighting"],
"avoid": ["oversaturated colors", "digital artifacts"]
}
这就像你的“该做和不该做”清单。
8、完整示例
将所有内容组合起来,如下所示:
{
"CORE_STRUCTURE": {
"organization": "Organize image prompts into logical JSON sections that build systematically",
"syntax": "Use proper syntax with correct brackets, commas, and quotation marks",
"visual_elements": "Separate visual elements into distinct objects for precise control",
"validation": "Validate JSON structure before submitting to avoid errors"
},
"STYLE_DEFINITION": {
"primary_style": ["photorealistic", "cinematic", "documentary"],
"rendering_quality": ["hyperrealistic", "detailed", "high-resolution"],
"surface_textures": ["authentic material properties", "natural wear patterns"],
"lighting": ["natural", "studio quality", "dramatic", "soft ambient"]
},
"TECHNICAL_SPECIFICATIONS": {
"camera_settings": ["depth of field", "focal length", "aperture effects", "exposure"],
"resolution": ["high definition minimum", "professional quality"],
"rendering": ["anti-aliasing", "noise levels", "color depth standards"],
"physics_accuracy": ["gravity effects", "structural believability"]
},
"MATERIAL_PROPERTIES": {
"skin_textures": ["pores", "natural imperfections", "ethnic diversity"],
"fabric_details": ["thread patterns", "realistic drape", "wear indicators"],
"surfaces": ["scratches", "patina", "authentic oxidation", "natural irregularities"],
"transparency": ["accurate refraction", "surface interactions"]
},
"ENVIRONMENTAL_FACTORS": {
"atmospheric_conditions": ["distance haze", "weather effects", "humidity"],
"time_season": ["lighting conditions", "seasonal elements", "temperature cues"],
"particle_effects": ["dust", "moisture", "atmospheric depth"]
},
"COMPOSITION_CONTROLS": {
"perspective": ["natural human vision", "photography composition rules"],
"framing": ["rule of thirds", "golden ratio", "professional positioning"],
"subject_placement": ["balanced", "aesthetically pleasing arrangement"]
},
"QUALITY_KEYWORDS": {
"include": ["hyperrealistic", "photographic quality", "natural lighting", "authentic textures"],
"avoid": ["digital artifacts", "unrealistic proportions", "oversaturated colors"],
"reference": ["National Geographic", "professional photography standards"]
}
}
你不需要写出完美的提示。只需将你的想法分解成几个部分:风格、相机、材料、环境、构图、质量。就是这样。
一旦你开始这样做,Gemini Nano Banana 就不再猜测,而是开始精准地满足你的要求。
原文链接:How to Write JSON Prompts for Gemini Nano Banana
汇智网翻译整理,转载请标明出处