Skip to content

Instantly share code, notes, and snippets.

@alexewerlof
Created December 19, 2025 17:44
Show Gist options
  • Select an option

  • Save alexewerlof/1d13401a7647339469141dc2960e66a9 to your computer and use it in GitHub Desktop.

Select an option

Save alexewerlof/1d13401a7647339469141dc2960e66a9 to your computer and use it in GitHub Desktop.
Nano Banana structured JSON prompt Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Nano Banana (Gemini 3 Pro) Ultimate Image Schema",
"description": "The definitive structured prompting schema for high-fidelity image generation. Includes advanced photography, multi-subject control, and text rendering.",
"type": "object",
"required": ["meta", "subject", "scene"],
"properties": {
"user_intent": {
"type": "string",
"description": "A natural language summary of your goal (e.g., 'Me high-fiving Batman in a neon city'). Useful for logging."
},
"meta": {
"type": "object",
"description": "Global settings for the image generator.",
"properties": {
"aspect_ratio": {
"type": "string",
"enum": ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "3:2", "2:3", "5:4", "4:5"],
"default": "16:9",
"description": "The dimensions of the output.\n• 16:9: Cinematic/Desktop\n• 9:16: TikTok/Phone Wallpaper\n• 1:1: Instagram Square\n• 21:9: Ultra-widescreen Movie"
},
"quality": {
"type": "string",
"enum": ["ultra_photorealistic", "standard", "raw", "anime_v6", "3d_render_octane", "oil_painting", "sketch", "pixel_art", "vector_illustration"],
"default": "ultra_photorealistic",
"description": "The rendering engine or 'mode'. Use 'raw' for uncompressed photo style."
},
"safety_filter": {
"type": "string",
"enum": ["block_none", "block_few", "block_some", "block_most"],
"default": "block_some"
},
"seed": {
"type": "integer",
"description": "Fixed number (e.g. 42) to reproduce the EXACT same image again."
},
"steps": {
"type": "integer",
"default": 40,
"minimum": 10,
"maximum": 100,
"description": "Denoising steps. Higher (50+) = more detail but slower. Lower (20) = faster but rougher."
},
"guidance_scale": {
"type": "number",
"default": 7.5,
"minimum": 1.0,
"maximum": 20.0,
"description": "How strictly the AI follows your prompt.\n• 1-4: Creative/Random\n• 7-10: Balanced (Default)\n• 15+: Strict/Rigid"
}
}
},
"subject": {
"type": "array",
"description": "List of characters or objects. Add multiple items to create multi-character scenes.",
"items": {
"type": "object",
"required": ["type", "description"],
"properties": {
"id": {
"type": "string",
"description": "Unique label (e.g., 'hero', 'villain') to reference this character internally."
},
"type": {
"type": "string",
"enum": ["person", "animal", "cyborg", "monster", "statue", "robot", "vehicle", "object"],
"default": "person"
},
"input_image": {
"type": "object",
"description": "Attach a reference photo SPECIFIC to this character (e.g., your face).",
"properties": {
"path": {
"type": "string",
"description": "Path to local file (./face.jpg) or URL."
},
"usage_type": {
"type": "string",
"enum": ["face_id", "pose_copy", "clothing_transfer", "depth_map", "full_character_reference", "style_transfer"],
"description": "• face_id: Swaps the face (Identity).\n• pose_copy: Copies the skeleton/stance.\n• clothing_transfer: Steals the outfit.\n• depth_map: Copies the 3D shape."
},
"strength": {
"type": "number",
"default": 0.85,
"minimum": 0.1,
"maximum": 1.0,
"description": "1.0 = Exact copy. 0.5 = Loose inspiration."
}
}
},
"description": {
"type": "string",
"description": "Visual traits: 'tall, muscular, scar on left eye, glowing cybernetics'."
},
"name": {
"type": "string",
"description": "If famous: 'Abraham Lincoln', 'Pikachu'. Triggers internal knowledge base."
},
"age": {
"type": "string",
"description": "Approximate age or life stage (e.g., '25 years old', 'elderly', 'toddler', 'middle-aged')."
},
"gender": {
"type": "string",
"enum": ["male", "female", "non-binary", "androgynous"],
"description": "Gender presentation of the subject."
},
"hair": {
"type": "object",
"description": "Hair style and color specifications.",
"properties": {
"style": {
"type": "string",
"enum": [
"bald", "buzz_cut", "crew_cut", "ivy_league", "caesar_cut", "french_crop",
"textured_crop", "fade_low", "fade_mid", "fade_high", "skin_fade", "taper_fade",
"undercut", "disconnected_undercut", "side_part", "hard_part", "comb_over",
"pompadour", "quiff", "slicked_back", "spiky", "faux_hawk", "mohawk", "mullet",
"modern_mullet", "shag_cut", "wolf_cut", "butterfly_cut", "hime_cut",
"pixie_cut", "bixie", "bob_cut", "french_bob", "blunt_bob", "lob_long_bob",
"shoulder_length", "layered_cut", "long_straight", "long_wavy", "long_curly",
"beach_waves", "hollywood_waves", "blowout", "curtain_bangs", "bottleneck_bangs",
"wispy_bangs", "blunt_bangs", "afro", "short_afro", "large_afro", "dreadlocks",
"locs", "faux_locs", "braids", "box_braids", "cornrows", "micro_braids",
"twists", "two_strand_twists", "bantu_knots", "ponytail", "high_ponytail",
"low_ponytail", "pigtails", "bun", "messy_bun", "top_knot", "man_bun",
"space_buns", "half_up_half_down", "wet_look", "windswept"
],
"description": "The specific cut or arrangement of the hair."
},
"color": {
"type": "string",
"enum": [
"jet_black", "soft_black", "dark_brown", "chestnut_brown", "light_brown",
"dark_blonde", "golden_blonde", "platinum_blonde", "strawberry_blonde",
"auburn", "dark_red", "ginger", "copper",
"grey", "silver", "white", "salt_and_pepper",
"pastel_pink", "hot_pink", "neon_green", "electric_blue", "navy_blue",
"royal_purple", "lavender", "teal", "rainbow", "ombre", "highlighted"
],
"description": "Natural or dyed hair color."
}
}
},
"position": {
"type": "string",
"enum": ["center", "left", "right", "far_left", "far_right", "background", "foreground", "floating_above", "sitting_on_ground"],
"description": "Where is this specific subject placed?"
},
"pose": {
"type": "string",
"description": "Action: 'running towards camera', 'sitting cross-legged', 'aiming weapon', 'looking over shoulder'."
},
"expression": {
"type": "string",
"enum": ["neutral", "smiling", "laughing", "angry", "screaming", "crying", "seductive", "stoic", "surprised", "tired", "suspicious", "pain"],
"default": "neutral"
},
"clothing": {
"type": "array",
"description": "Garments worn by the subject. Separated from accessories to ensure accurate material rendering.",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"description": "e.g., 'bomber jacket', 'pleated skirt', 'tactical vest', 'kimono'."
},
"color": {
"type": "string",
"description": "e.g., 'neon pink', 'matte black', 'iridescent'."
},
"fabric": {
"type": "string",
"enum": ["cotton", "wool", "silk", "linen", "denim", "leather", "latex", "velvet", "chiffon", "satin", "nylon", "spandex", "lace", "tweed", "corduroy", "fur", "fleece", "mesh", "cashmere", "flannel", "sequins"],
"description": "The specific textile material."
},
"pattern": {
"type": "string",
"enum": ["solid", "striped", "plaid", "polka_dot", "floral", "camouflage", "tie_dye", "geometric", "animal_print", "paisley", "checked", "gradient"],
"description": "Visual pattern on the fabric."
},
"fit": {
"type": "string",
"enum": ["tight", "slim", "regular", "loose", "oversized", "baggy", "fitted", "flowy"]
},
"layer": {
"type": "string",
"enum": ["underwear", "inner", "middle", "outer", "coat"]
}
}
}
},
"accessories": {
"type": "array",
"description": "Jewelry, bags, eyewear, and other non-clothing items.",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"description": "e.g., 'sunglasses', 'gold chain', 'tactical backpack', 'crown'."
},
"material": {
"type": "string",
"enum": [
"gold", "silver", "plastic", "wood", "glass", "metal", "diamond", "pearl",
"leather", "bone", "obsidian", "chrome", "fabric", "canvas", "straw",
"feathers", "paper", "resin", "rubber", "silicone", "ceramic", "crystal",
"stone", "rope", "enamel", "carbon_fiber"
],
"description": "Material of the accessory."
},
"color": {
"type": "string",
"description": "e.g. 'rose gold', 'transparent'."
},
"location": {
"type": "string",
"enum": ["head", "face", "ears", "neck", "wrists", "fingers", "waist", "back", "held_in_hand", "floating_nearby"]
}
}
}
}
}
}
},
"scene": {
"type": "object",
"description": "Environment and Atmosphere.",
"properties": {
"location": {
"type": "string",
"examples": ["tokyo street", "bedroom", "mars colony", "forest", "white void", "studio", "coffee shop", "cyberpunk alley", "medieval castle"],
"description": "The setting."
},
"time": {
"type": "string",
"enum": ["golden_hour", "blue_hour", "high_noon", "midnight", "sunrise", "sunset", "twilight", "pitch_black"]
},
"weather": {
"type": "string",
"enum": ["clear_skies", "overcast", "rainy", "stormy", "snowing", "foggy", "hazy", "sandstorm", "acid_rain"]
},
"lighting": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["natural_sunlight", "studio_softbox", "hard_flash", "neon_lights", "candlelight", "cinematic", "bioluminescent", "firelight", "god_rays", "rembrandt"],
"description": "The source and quality of light."
},
"direction": {
"type": "string",
"enum": ["front_lit", "back_lit", "side_lit", "top_down", "rim_light", "silhouette", "under_lit"],
"description": "Direction relative to the subject."
}
}
},
"background_elements": {
"type": "array",
"items": { "type": "string" },
"description": "Specific items to populate the background (e.g., 'flying cars', 'cherry blossoms')."
}
}
},
"technical": {
"type": "object",
"description": "Virtual Photography / Camera Settings.",
"properties": {
"camera_model": {
"type": "string",
"enum": ["iPhone 15 Pro", "Sony A7R IV", "Leica M6", "Canon EOS R5", "Hasselblad X2D", "Polaroid Now", "GoPro Hero 12", "CCTV Security Cam"],
"description": "Simulates the sensor and color science of specific cameras."
},
"lens": {
"type": "string",
"enum": ["16mm", "24mm", "35mm", "50mm", "85mm", "105mm", "200mm", "400mm", "macro_100mm", "fisheye_8mm"],
"description": "Zoom Level.\n• 16mm: Ultra Wide/Action\n• 35-50mm: Natural/Street\n• 85mm: Portrait (Flattering)\n• 200mm: Compressed/Spy"
},
"aperture": {
"type": "string",
"enum": ["f/1.2", "f/1.4", "f/1.8", "f/2.8", "f/4.0", "f/5.6", "f/8.0", "f/11", "f/16"],
"description": "Depth of Field.\n• f/1.2 - f/1.8: Creamy Bokeh (Blurry Background)\n• f/2.8 - f/4: Standard Portrait\n• f/8 - f/16: Everything sharp (Landscape)"
},
"shutter_speed": {
"type": "string",
"enum": ["1/8000", "1/4000", "1/1000", "1/500", "1/250", "1/125", "1/60", "1/30", "1/15", "1s", "long_exposure_bulb"],
"description": "Motion Control.\n• 1/8000: Frozen water droplets\n• 1/60: Natural motion blur\n• long_exposure: Light trails"
},
"iso": {
"type": "string",
"enum": ["100", "200", "400", "800", "1600", "3200", "6400", "12800"],
"description": "Grain/Noise Level.\n• 100: Clean/Sharp\n• 3200+: Gritty/Vintage/Noisy"
},
"film_stock": {
"type": "string",
"enum": ["Kodak Portra 400", "Kodak Gold 200", "Kodak Ektar 100", "Fujifilm Pro 400H", "Fujifilm Velvia 50", "CineStill 800T", "Ilford HP5 Plus (B&W)", "Kodak Tri-X 400 (B&W)", "Polaroid 600", "Kodachrome 64"],
"description": "Color Grading Preset.\n• Portra: Warm, skin tones\n• CineStill: Halos around lights, cinematic\n• Ilford: Classic Black & White"
}
}
},
"composition": {
"type": "object",
"description": "Framing and Angle.",
"properties": {
"framing": {
"type": "string",
"enum": ["extreme_close_up", "close_up", "medium_shot", "cowboy_shot", "full_body", "wide_shot", "extreme_wide_shot", "macro_detail"],
"description": "How much of the subject is visible?"
},
"angle": {
"type": "string",
"enum": ["eye_level", "low_angle", "high_angle", "dutch_angle", "bird_eye_view", "worm_eye_view", "overhead", "pov", "drone_view"],
"description": "Camera height and tilt."
},
"focus_point": {
"type": "string",
"enum": ["face", "eyes", "hands", "background", "foreground_object", "whole_scene"],
"description": "What is strictly in focus?"
}
}
},
"text_rendering": {
"type": "object",
"description": "Generate legible text inside the image (Signs, Shirts, Posters).",
"properties": {
"enabled": { "type": "boolean", "default": false },
"text_content": {
"type": "string",
"description": "The EXACT string to write. Keep it under 5 words for best results."
},
"placement": {
"type": "string",
"enum": ["floating_in_air", "neon_sign_on_wall", "printed_on_tshirt", "graffiti_on_wall", "smart_phone_screen", "computer_monitor", "book_cover", "movie_poster", "subtitles"],
"description": "Where should the text appear?"
},
"font_style": {
"type": "string",
"enum": ["bold_sans_serif", "elegant_serif", "handwritten", "cyberpunk_digital", "graffiti_tag", "gothic", "retro_pixel", "neon_tube"],
"description": "The typography style."
},
"color": {
"type": "string",
"description": "Color of the text (e.g., 'glowing cyan')."
}
}
},
"style_modifiers": {
"type": "object",
"description": "Artistic styles and aesthetic overrides.",
"properties": {
"medium": {
"type": "string",
"enum": ["photography", "3d_render", "oil_painting", "watercolor", "pencil_sketch", "ink_drawing", "anime", "concept_art", "digital_illustration", "claymation", "papercraft"]
},
"aesthetic": {
"type": "array",
"items": {
"type": "string",
"enum": ["cyberpunk", "steampunk", "vaporwave", "synthwave", "noir", "minimalist", "maximalist", "gothic", "baroque", "retro_80s", "vintage_50s", "futuristic", "post_apocalyptic", "ethereal", "dreamcore", "weirdcore"]
}
},
"artist_reference": {
"type": "array",
"items": { "type": "string" },
"description": "Names of artists to mimic (e.g., 'Greg Rutkowski', 'Alphonse Mucha'). Use with caution."
}
}
},
"advanced": {
"type": "object",
"description": "Negative prompts and fine-tuning.",
"properties": {
"negative_prompt": {
"type": "array",
"items": { "type": "string" },
"default": ["blur", "low quality", "distortion", "watermark", "text", "bad hands", "extra fingers", "mutated", "cropped", "worst quality"],
"description": "Elements to forcefully EXCLUDE."
},
"magic_prompt_enhancer": {
"type": "boolean",
"default": true,
"description": "If true, the AI expands your prompt with adjectives to make it prettier."
},
"hdr_mode": {
"type": "boolean",
"default": true,
"description": "High Dynamic Range. Balances shadows and highlights."
}
}
}
}
}
@alexewerlof
Copy link
Author

alexewerlof commented Dec 19, 2025

image

Example Created using the Schema above in VS Code

Nano Banana (Gemini 3 Pro) Ultimate Image Schema

This is a JSON Schema designed to bring structure, type safety, and rich auto-completion to your AI image generation workflow. It is specifically tuned for the Gemini 3 Pro (codenamed "Nano Banana") architecture, but the photographic principles apply to Flux, Midjourney, and Stable Diffusion as well.

Why use this?

Instead of guessing random keywords like "8k, masterpiece, best quality", this schema forces you to think like a photographer and director. It exposes hidden parameters for:

  • Virtual Photography: Aperture, Lens Focal Length, ISO, and Film Stock.
  • Multi-Subject Control: Define specific outfits and poses for different characters without color bleeding.
  • Text Rendering: Controls for placing legible text inside images.

How to use in VS Code

1. Installation

  1. Download the schema.json file from this Gist.
  2. Place it in a known folder (e.g., ~/schemas/ or inside your project).
  3. Tell your IDE to use the schema for the JSON structure:
{
    "$schema": "./path-to-schema.json",
    // The rest of your properties with the help of IDE auto-completion
}
  1. Copy your JSON and just paste it in Gemini. Optionally choose Create Images from the Tools and upload images that you own.
  2. Don't forget to give it a star ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment