GPT-Image2 Prompt Template Structure: Complete JSON Specification Guide

A GPT-Image2 prompt template is a hierarchical JSON specification that decomposes image generation instructions into logical sections including style, structure, content, camera settings, and output constraints.

The freestylefly/awesome-gpt-image-2 repository defines a standardized schema for structuring complex visual prompts. This system enables agents to construct precise, category-specific prompts by filling placeholder values within self-documenting JSON blocks before submitting to the image generation API.

Core Architecture of GPT-Image2 Prompt Templates

According to docs/templates.md (lines 27–28, 363–370), the template follows a flexible object structure where each top-level key represents a distinct aspect of image composition. While all fields remain optional, the structure adapts dynamically to template categories such as UI, infographic, poster, product, or character.

The standard schema includes these primary blocks:

  • style – Color palettes, lighting moods, and artistic textures
  • structure – Layout primitives, typography, and component arrangements
  • content – Placeholder variables for titles, descriptions, and data points
  • camera – Lens specifications, focal length, and lighting directions
  • scene – Subject definitions, background elements, and atmospheric effects
  • quality_constraints – Resolution limits, aspect ratios, and negative prompts
  • output_requirements – Delivery format, file type, and sizing rules

Visual Style and Aesthetic Controls

The style block defines the overall visual identity through properties like palette, texture, and mood. As shown in docs/templates.md (lines 533–540), this section ensures consistent artistic direction across generated assets.

{
  "style": {
    "palette": "cool-blue",
    "texture": "smooth-glass"
  }
}

Layout Structure and Composition

The structure field describes spatial arrangements specific to the template category. For UI templates, this includes headers, sidebars, and content cards. For poster templates, it defines headline placement and visual hierarchy.

Content Placeholders and Variable Substitution

The content block contains placeholder syntax using brace notation (e.g., {title}, {subject}, {cardDesc}). According to agents/skills/gpt-image-2-style-library/SKILL.md, agents execute a substitution workflow that copies the template block, replaces placeholder braces with concrete values, and assembles the final prompt payload.

Camera and Lighting Parameters

The camera section specifies technical photographic details including lens type (e.g., "50mm"), aperture settings, and lighting directions ("soft-front", "dramatic-side"). This enables precise control over perspective and illumination.

Specialized Template Categories

Different prompt types leverage optional specialized blocks based on their category. The category index in agents/skills/gpt-image-2-style-library/references/style-library.md maps template identifiers like #tpl-ui, #tpl-poster, and #tpl-product to their respective JSON schemas.

Character, Brand, and Product Blocks

  • character – Defines pose, expression, and physical attributes for portrait templates (lines 661–663 in docs/templates.md)
  • brand – Specifies logo placement, typography, and identity elements for marketing materials
  • product – Details packaging, angles, and e-commerce display requirements

Scene and Environment Descriptors

The scene block outlines atmospheric elements including background details, props, and environmental effects (fog, glow, particles), critical for architectural and landscape prompts.

Quality Constraints and Output Requirements

The quality_constraints field enforces technical limits such as aspect ratio ("16:9"), maximum resolution ("4k"), and prohibitions against specific artifacts. The output_requirements section specifies delivery formats (PNG, JSON) and absolute dimensions ("1200x1800").

Implementation Examples

Minimal UI template excerpt from docs/templates.md (lines 533–540):

{
  "style": {
    "palette": "cool-blue",
    "texture": "smooth-glass"
  },
  "structure": {
    "header": {"title": "{title}", "icon": "app"},
    "sidebar": {"items": ["{item1}", "{item2}", "{item3}"]},
    "content": {"cards": [{"title": "{cardTitle}", "description": "{cardDesc}"}]}
  },
  "camera": {
    "lens": "50mm",
    "lighting": "soft-front"
  },
  "quality_constraints": {
    "aspect_ratio": "16:9",
    "max_resolution": "4k"
  }
}

Poster template excerpt from docs/templates.md (lines 703–711):

{
  "style": {"mood": "dramatic", "colour": "high-contrast"},
  "structure": {"headline": "{headline}", "subhead": "{subhead}", "visual": "{visual_desc}"},
  "scene": {"subject": "{subject}", "background": "{bg_desc}"},
  "output_requirements": {"format": "png", "size": "1200x1800"}
}

Repository File Structure

The template system is organized across several authoritative files in the freestylefly/awesome-gpt-image-2 repository:

Summary

  • GPT-Image2 prompt templates use a hierarchical JSON structure with optional top-level keys for style, structure, content, camera, scene, and specialized categories.
  • Placeholder variables in braces (e.g., {title}, {subject}) enable dynamic content injection by agents before API submission.
  • Template categories (UI, poster, product, brand, etc.) activate specialized blocks like character descriptors or product specifications only when relevant.
  • Quality constraints and output requirements enforce technical specifications for resolution, aspect ratio, and delivery format.
  • The system is self-documenting with example values embedded directly in docs/templates.md.

Frequently Asked Questions

What file contains the complete GPT-Image2 prompt template definitions?

The complete specifications reside in docs/templates.md, which contains JSON blocks for all categories including UI, infographic, poster, and product templates, with specific line references at 363–370 and 703–711 documenting the schema structure.

How do agents populate placeholder values in a GPT-Image2 template?

According to agents/skills/gpt-image-2-style-library/SKILL.md, agents copy the selected template block, substitute placeholder braces (e.g., {subject}, {title}) with concrete user values, and return the assembled prompt to the image generation API.

Which template categories support the character and brand blocks?

Character blocks appear in portrait and scene templates, while brand and product blocks activate for marketing and e-commerce categories, as indexed in agents/skills/gpt-image-2-style-library/references/style-library.md with identifiers like #tpl-brand and #tpl-product.

Are all fields in the GPT-Image2 prompt template required?

No, all top-level keys are optional. The template adapts to its category, including only relevant sections such as camera settings for photography templates or structure blocks for UI designs, as implemented in the schema defined in docs/templates.md.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →