关于 Nano Banana 2 Image Generation Master
此技能为 Nano Banana 2 或连接到 `generate_image` 的模型规范图像生成提示词,提供 JSON 结构和偏向写实效果的提示指导,并说明 fal.ai 与 Euri API 的执行方式。
主要功能
- 01结构化 JSON 提示词规范
- 02密集叙述式提示词格式
- 03相机与光线细节指导
- 04负面提示词要求
- 05支持输入参考图
- 06fal.ai 与 Euri 执行说明
适用场景
- 01编写详细的写实图像提示词
- 02使用参考图准备提示词
- 03通过 fal.ai 或 Euri 生成图像
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ aiagentwithdhruv/ skills --skill nano-banana-2-image-generation-master安装后在 Claude Code 中输入/nano-banana-2-image-generation-master确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
gemini.mdmaster_prompt_reference.mdscripts/get_kie_image.pygenerate_kie.py详细介绍
Nano Banana 2 图像生成大师
目标
本技能旨在提供一种标准化且高度可控的方法,使用 AI 模型 Nano Banana 2(或任何连接到 generate_image 工具的底层模型)生成图像。通过严格执行结构化的 JSON 参数架构,本技能可以消除模型的固有偏差(例如过度平滑、数据集平均化或“塑料感”的 AI 风格),并确保输出原始、未经修饰且超写实。
先决条件
- fal.ai API 密钥(
.env中的FAL_KEY)——在 https://fal.ai 注册(免费套餐,Nano Banana 2 模型) - 或 Euri API 密钥(
.env中的EURI_API_KEY)——Euron 学生可在 https://euron.one/euri 免费使用 - 清楚了解用户对主体、光线和相机特性的要求。
核心架构结构
为 generate_image 工具构建提示词时,必须以以下 JSON 架构为基础。填写字符串值时,务必提供极其细致入微的描述。
{
"task": "string - High-level goal (e.g., 'sports_selfie_collage', 'single_macro_portrait')",
"output": {
"type": "string - e.g., 'single_image', '4-panel_collage'",
"layout": "string - e.g., '1x1', '2x2_grid', 'side-by-side'",
"aspect_ratio": "string - e.g., '3:4', '16:9', '4:5'",
"resolution": "string - e.g., 'ultra_high', 'medium_low'",
"camera_style": "string - e.g., 'smartphone_front_camera', 'professional_dslr'"
},
"image_quality_simulation": {
"sharpness": "string - e.g., 'tack_sharp', 'slightly_soft_edges'",
"noise": "string - e.g., 'unfiltered_sensor_grain', 'visible_film_grain', 'clean_digital'",
"compression_artifacts": "boolean - true if attempting to simulate uploaded UGC",
"dynamic_range": "string - e.g., 'limited', 'hdr_capable'",
"white_balance": "string - e.g., 'slightly_warm', 'cool_fluorescent'",
"lens_imperfections": [
"array of strings - e.g., 'subtle chromatic aberration', 'minor lens distortion', 'vignetting'"
]
},
"subject": {
"type": "string - e.g., 'human_portrait', 'nature_macro', 'infographic_flatlay'",
"human_details": {
"//": "Use this block ONLY for human subjects",
"identity": "string",
"appearance": "string - Extremely specific (e.g., visible pores, mild redness)",
"outfit": "string"
},
"object_or_nature_details": {
"//": "Use this block for non-human subjects",
"material_or_texture": "string - e.g., 'brushed aluminum', 'dew-covered velvety petals'",
"wear_and_tear": "string - e.g., 'subtle scratches on the anodized finish', 'browning edges on leaves'",
"typography": "string - e.g., 'clean sans-serif overlaid text, perfectly legible'"
}
},
"multi_panel_layout": {
"grid_panels": [
{
"panel": "string - e.g., 'top_left', 'full_frame' (if not a grid)",
"pose": "string - e.g., 'slight upward selfie angle, relaxed smile'",
"action": "string - e.g., 'holding phone with one hand, casual posture'"
}
]
},
"environment": {
"location": "string - e.g., 'gym or outdoor sports area'",
"background": "string - What is behind the subject (e.g., 'blurred gym equipment')",
"lighting": {
"type": "string - e.g., 'natural or overhead gym lighting', 'harsh direct sunlight'",
"quality": "string - e.g., 'uneven, realistic, non-studio', 'high-contrast dramatic'"
}
},
"embedded_text_and_overlays": {
"text": "string (optional)",
"location": "string (optional)"
},
"structural_preservation": {
"preservation_rules": [
"array of strings - e.g., 'Exact physical proportions must be preserved'"
]
},
"controlnet": {
"pose_control": {
"model_type": "string - e.g., 'DWPose'",
"purpose": "string",
"constraints": ["array of strings"],
"recommended_weight": "number"
},
"depth_control": {
"model_type": "string - e.g., 'ZoeDepth'",
"purpose": "string",
"constraints": ["array of strings"],
"recommended_weight": "number"
}
},
"explicit_restrictions": {
"no_professional_retouching": "boolean - typically true for realism",
"no_studio_lighting": "boolean - typically true for candid shots",
"no_ai_beauty_filters": "boolean - mandatory true to avoid plastic look",
"no_high_end_camera_look": "boolean - true if simulating smartphones"
},
"negative_prompt": {
"forbidden_elements": [
"array of strings - Massive list of 'AI style' blockers required for extreme realism. Example stack: 'anatomy normalization', 'body proportion averaging', 'dataset-average anatomy', 'wide-angle distortion not in reference', 'lens compression not in reference', 'cropping that removes volume', 'depth flattening', 'mirror selfies', 'reflections', 'beautification filters', 'skin smoothing', 'plastic skin', 'airbrushed texture', 'stylized realism', 'editorial fashion proportions', 'more realistic reinterpretation'"
]
}
}
范式 2:密集叙述格式(针对 fal.ai 等 API 优化)
调用通常只接受字符串提示词的标准生成端点时,将上述逻辑浓缩为包含大量描述性文本块的扁平 JSON 字符串,效果非常出色。
{
"prompt": "string - A dense, ultra-descriptive narrative. Use specific camera math (85mm lens, f/1.8, ISO 200), explicit flaws (visible pores, mild redness, subtle freckles, light acne marks), lighting behavior (direct on-camera flash creating sharp highlights), and direct negative commands (Do not beautify or alter facial features).",
"negative_prompt": "string - A comma-separated list of explicit realism blockers (no plastic skin, no CGI).",
"image_input": [
"array of strings (URLs) - Optional. Input images to transform or use as reference (up to 14). Formatting: URL to jpeg, png, or webp. Max size: 30MB."
],
"api_parameters": {
"google_search": "boolean - Optional. Use Google Web Search grounding",
"resolution": "string - Optional. '1K', '2K', or '4K' (default 1K)",
"output_format": "string - Optional. 'jpg' or 'png' (default jpg)",
"aspect_ratio": "string - Optional. Overrides CLI aspect_ratio (e.g., '16:9', '4:5', 'auto')"
},
"settings": {
"resolution": "string",
"style": "string - e.g., 'documentary realism'",
"lighting": "string - e.g., 'direct on-camera flash'",
"camera_angle": "string",
"depth_of_field": "string - e.g., 'shallow depth of field'",
"quality": "string - e.g., 'high detail, unretouched skin'"
}
}
最佳实践与自然语言技巧
- **相机参数计算:**始终明确指定精确的焦距、光圈和 ISO(例如,
85mm lens, f/2.0, ISO 200)。这会迫使模型模拟光学物理效果,而非数字渲染。 - **明确瑕疵:**仅使用“逼真”一词还不够。应具体描述缺陷:
轻微泛红、细微雀斑、浅淡的痘印、未经修饰的仪容。 - **直接指令:**在正向提示词段落中加入祈使式否定指令:
不要美化或改变面部特征。不要使用化妆风格。 - **光线效果:**不要只说出光线的名称,还要描述其效果:
直闪摄影,在皮肤上形成清晰的高光,背景略显阴暗。 - **非人类材质(产品/自然):**生成非人类主体时,应将皮肤/服装相关描述替换为精确的材质物理特性。描述表面刮痕(例如,“阳极氧化铝上的微小划痕”)、光线散射(例如,“光线穿过覆有露珠的花瓣时产生的次表面散射”)或图形布局(例如,“平铺构图、简洁的无衬线字体”)。
- **必须包含负面提示词:**必须加入详尽的负面提示词块(例如,禁止“皮肤平滑处理”和“解剖结构规范化”)。
- **避免过度劣化(噪点陷阱):**模拟相机缺陷(如
compression artifacts)有助于增强真实感,但在霓虹夜街等复杂、高对比度环境中使用极端的ISO 3200或heavy film grain,反而会触发模型对“数字艺术/插画”的偏好。ISO 设置应低于 800,并依靠主体本身的物理瑕疵(如桃色绒毛或不对称的毛孔),而不是明显的相机噪点,来营造真实感。
大师参考指南
如需完整的架构拆解、参数选项或多面板网格的复杂 JSON 结构,请参阅:
master_prompt_reference.md(位于此技能文件夹中)
通过 fal.ai 执行(主要方式——取代 kie.ai)
使用 fal.ai 的 Nano Banana 2 模型生成超写实图像。
先决条件:
.env文件中必须包含FAL_KEY="your_key"(在 https://fal.ai/dashboard/keys 获取)- 将符合密集叙述格式的 JSON 提示词文件保存到
/prompts/
执行:
# Using the Videos toolkit script (recommended) — defaults to nano-banana-2
python Social-Media-Agent-1.0/Videos/scripts/generate_fal.py "<dense_prompt>" output.jpg --size portrait_4_3
# Or using the legacy kie.ai script (if you still have KIE_API_KEY)
python scripts/generate_kie.py prompts/your_prompt.json images/output_image.jpg "4:5"
通过 Euri API 执行(替代方式——学生免费)
使用 Euri 的 Gemini 3 Pro Image Preview 模型。
python Social-Media-Agent-1.0/Videos/scripts/generate_euri.py "<dense_prompt>" output.jpg
环境变量:.env 中的 EURI_API_KEY | 免费额度:每天 200K 个令牌
如何使用此技能
当用户要求生成高度精细、逼真或复杂的图像时,你必须严格按照上述 JSON 架构构建提示词字符串。将整个字符串作为提示词参数传递给生成脚本(优先使用 fal.ai,备用方案为 Euri)。