SuperAPI AI Directory

json-image-prompt

Design & creation

View repository

Updated 10-16 05:07

About this skill

JSON Image Prompt Skill

When generating images, always decompose the user's request into a structured JSON prompt before calling generate_image. JSON prompts eliminate ambiguity, improve consistency, and give the AI model clearer instructions.

Why JSON Over Free-Form Text

Free-form JSON
"A beautiful sunset over mountains with dramatic lighting" Each attribute is a separate, unambiguous key-value pair
Model guesses what "beautiful" and "dramatic" mean You define exactly: golden hour, rim lighting, warm tones
Hard to iterate — rewrite everything Change one field, keep the rest
Inconsistent results across runs Same structure = reproducible quality

JSON Prompt Schema

Always structure the prompt as a JSON object with these fields:

{
  "subject": {
    "type": "描述主体是什么(人物/物体/场景)",
    "details": "关键特征、姿态、表情、材质",
    "framing": "构图方式(全身/半身/特写/鸟瞰)"
  },
  "environment": {
    "setting": "场景描述",
    "time": "时间/时段",
    "weather": "天气/氛围条件"
  },
  "style": {
    "genre": "视觉风格(photorealistic/illustration/anime/oil-painting/3d-render/watercolor/flat-design)",
    "reference": "参考美学(如 Studio Ghibli / Swiss design / Brutalist / Art Deco)",
    "color_palette": "色彩倾向(warm/cool/monochrome/muted/vibrant + 具体色号如有)"
  },
  "lighting": {
    "type": "光源类型(natural/studio/neon/ambient/volumetric)",
    "direction": "光线方向(front/back/side/top/rim)",
    "quality": "光线质感(soft/harsh/diffused/dramatic/golden-hour)"
  },
  "camera": {
    "angle": "拍摄角度(eye-level/low-angle/high-angle/dutch-angle/overhead)",
    "lens": "镜头(wide-angle/telephoto/macro/fisheye/tilt-shift)",
    "depth_of_field": "景深(shallow/deep/selective)"
  },
  "mood": "情绪基调(1-3个关键词)",
  "negative": "需要避免的元素(可选)"
}

Workflow

Step 1: Analyze user intent

When the user says "help me generate a tech-style product image," do not directly write a one-sentence prompt. First break it down:

  • Subject: product (what product? what angle?)
  • Style: tech feel → minimalist, clean, futuristic
  • Lighting: tech feel is usually studio, rim lighting
  • Mood: professional, modern, premium

Step 2: Build the JSON Prompt

{
  "subject": {
    "type": "wireless earbuds",
    "details": "matte black finish, floating in air, slight rotation showing both sides",
    "framing": "centered product shot"
  },
  "environment": {
    "setting": "pure dark gradient background",
    "time": "N/A (studio)",
    "weather": "N/A"
  },
  "style": {
    "genre": "photorealistic product photography",
    "reference": "Apple product page aesthetic",
    "color_palette": "dark with selective blue and white accents"
  },
  "lighting": {
    "type": "studio",
    "direction": "rim lighting from behind, subtle fill from front",
    "quality": "dramatic, high contrast"
  },
  "camera": {
    "angle": "eye-level, slightly elevated",
    "lens": "macro, 100mm equivalent",
    "depth_of_field": "shallow, product in sharp focus"
  },
  "mood": "premium, futuristic, minimal",
  "negative": "text, watermark, human hands, cluttered background"
}

Step 3: Convert to a Prompt string

Flatten the JSON into a structured prompt text and pass it to generate_image:

Product photography of wireless earbuds, matte black finish, floating in air with slight rotation showing both sides. Centered product shot. Pure dark gradient background. Photorealistic product photography, Apple product page aesthetic. Dark palette with selective blue and white accents. Studio rim lighting from behind with subtle fill from front, dramatic high contrast. Eye-level macro shot at 100mm, shallow depth of field with product in sharp focus. Premium, futuristic, minimal mood. --no text, watermark, human hands, cluttered background

Rule: When converting JSON → prompt, order by importance: subject > style > lighting > camera > environment > mood > negative

Scenario Templates

Portrait Photography

{
  "subject": {
    "type": "portrait of [person description]",
    "details": "[expression], [clothing], [pose]",
    "framing": "bust shot / headshot / full body"
  },
  "style": {
    "genre": "editorial photography",
    "color_palette": "warm skin tones, muted background"
  },
  "lighting": {
    "type": "natural",
    "direction": "side, Rembrandt lighting pattern",
    "quality": "soft, golden hour"
  },
  "camera": {
    "lens": "85mm portrait lens",
    "depth_of_field": "shallow, f/1.8"
  },
  "mood": "intimate, contemplative"
}

Concept Illustration

{
  "subject": {
    "type": "[concept or scene]",
    "details": "[key visual elements]",
    "framing": "wide establishing shot"
  },
  "style": {
    "genre": "digital illustration",
    "reference": "[art style reference]",
    "color_palette": "[specific palette or mood-based]"
  },
  "lighting": {
    "type": "volumetric / atmospheric",
    "quality": "cinematic"
  },
  "mood": "[2-3 emotion keywords]"
}

Brand/Marketing Visuals

{
  "subject": {
    "type": "[product or brand element]",
    "details": "[brand-specific details]",
    "framing": "hero shot"
  },
  "style": {
    "genre": "commercial photography / 3d-render",
    "reference": "[brand aesthetic]",
    "color_palette": "[brand colors]"
  },
  "lighting": {
    "type": "studio, three-point",
    "quality": "clean, professional"
  },
  "mood": "aspirational, on-brand"
}

Important Principles

  1. Before generating an image each time, first build the JSON structure internally, even if you do not output it to the user
  2. Subject is always the most important — if the subject is not described clearly, no other parameters will help
  3. Less is more — use precise 2-5 words per field, do not write prose
  4. The negative field is critical — explicitly exclude unwanted elements (text, watermarks, distortion, etc.)
  5. Iterative optimization — if the first result is not ideal, adjust only 1-2 fields and retry, do not rewrite everything
  6. Colors should be specific — "warm tones" is not as good as "golden amber (#D4A574) with deep burgundy (#722F37) accents"
  7. When there is a brand kit — use get_brand_kit to get brand colors and fonts, and inject them into style.color_palette and subject.details