# GPT-Image2 Prompt Template Structure: Complete JSON Specification Guide

> Discover the GPT-Image2 prompt template structure a detailed JSON guide. Learn how to organize image generation instructions for optimal results.

- Repository: [苍何/awesome-gpt-image-2](https://github.com/freestylefly/awesome-gpt-image-2)
- Tags: api-reference
- Published: 2026-09-09

---

**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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) (lines 533–540), this section ensures consistent artistic direction across generated assets.

```json
{
  "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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) (lines 533–540):

```json
{
  "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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) (lines 703–711):

```json
{
  "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:

- **[`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md)** – Comprehensive collection of all template categories and JSON specifications (referenced at lines 27–28, 110–114, 447–455, 796–801, 896–901, 967–971, 1054–1057)
- **[`agents/skills/gpt-image-2-style-library/references/style-library.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/agents/skills/gpt-image-2-style-library/references/style-library.md)** – Category index linking template IDs to their source definitions
- **[`agents/skills/gpt-image-2-style-library/SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/agents/skills/gpt-image-2-style-library/SKILL.md)** – Agent workflow documentation explaining template selection and placeholder substitution
- **[`README.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/README.md)** – Overview and navigation links for template categories

## 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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md).

## Frequently Asked Questions

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

The complete specifications reside in **[`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/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`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md).