How to Use the "Other Use Cases" Templates in GPT-Image2 for Custom Workflows

The "Other Use Cases" templates in GPT-Image2 provide a flexible, fill-in-the-blank prompt skeleton located in docs/templates.md that generates both primary and fallback visual assets for experimental or mixed-task workflows when you map a case to the "other" category in data/style-library.json.

GPT-Image2 is an open-source project that ships with industrial-grade prompt templates for generating high-quality visual assets. The "Other Use Cases" templates serve as a catch-all category for mixed-task, experimental, or special-output workflows that do not fit standard visual domains like UI design or product photography.

Locating the "Other Use Cases" Template in the Source Code

The template definitions reside in docs/templates.md, with the "Other Use Cases" block starting at line 11113 and marked with the anchor tpl-other. This location contains both the plain-text skeleton and JSON-enhanced variations.

The system registers this category in data/style-library.json through the entry with "id": "other" (lines 200-203). The React UI in src/main.jsx (line 514) maps this ID to the user-facing label "Other Use Cases", ensuring the frontend displays the correct template category when selected.

Understanding the Template Structure

The template employs a generic skeleton with four constraint categories that you populate with concrete values:

  • 任务目标 (Objective): Define the content type you want to generate.
  • 输入约束 (Input Constraints): Specify subject, scene, style, and color palette.
  • 质量约束 (Quality Constraints): Set resolution (e.g., 高清/4K), aspect ratio, and composition.
  • 输出约束 (Output Constraints): Define usage context and key messaging priorities.

Every prompt using this template must request dual outputs: 一版主方案 + 一版备选方案 (one primary scheme plus one alternative scheme). This ensures you receive both a primary visual asset and a fallback variant for comparison.

How the System Discovers and Applies the Template

When the GPT-Image2 generator runs via scripts/generate-site-data.mjs (lines 49-96), it selects templates based on the "category" field in data/cases.json. If a case specifies "category": "Other Use Cases", the system automatically retrieves the template anchored at tpl-other from docs/templates.md.

This discovery mechanism connects the JSON data layer to the Markdown template layer, allowing the React frontend to render the correct prompt structure when users select experimental or mixed-use cases from the gallery defined in docs/gallery.md.

Practical Usage Examples

Plain-Text Workflow

Fill in the bracketed placeholders with specific values for your scenario:

任务目标:生成一张用于内部技术评审的概念图。
输入约束:主体新型可穿戴设备,场景高科技实验室,风格极简未来,色彩冷蓝+银灰。
质量约束:清晰度4K,比例16:9,构图对称。
输出约束:用于PowerPoint演示,需突出产品的交互界面。
请输出一版主方案 + 一版备选方案。

JSON-Enhanced Workflow

For agents that accept structured prompts, use the "JSON 进阶模板" pattern:

{
  "type": "Custom Generation",
  "objective": "Generate a concept illustration for a wearable prototype",
  "inputs": {
    "subject": "a sleek wrist-mounted AR device",
    "scene": "high-tech lab with holographic displays",
    "style": "minimalist futuristic",
    "palette": "cool blues and metallic silvers"
  },
  "quality_constraints": {
    "resolution": "4K",
    "aspect_ratio": "16:9",
    "composition": "symmetrical"
  },
  "output_requirements": {
    "usage": "PowerPoint slide for tech review",
    "focus": "highlight interactive UI elements"
  }
}

When to Use the "Other Use Cases" Category

Because this template does not prescribe a fixed visual domain, it excels in three specific scenarios:

  • Creative Experiments: Test novel styles, unusual aspect ratios, or generative techniques that fall outside standard categories.
  • Mixed-Workflow Pipelines: Generate composite assets such as a UI mock-up paired with an accompanying illustration in a single request.
  • Special-Purpose Assets: Create quick-look mock-ups for brainstorming sessions, client pitches, or internal documentation where formal template constraints would be too restrictive.

Summary

  • The "Other Use Cases" template lives in docs/templates.md at the tpl-other anchor and provides a flexible, four-section prompt structure.
  • Category registration occurs in data/style-library.json ("id": "other"), while src/main.jsx handles the UI label mapping.
  • The scripts/generate-site-data.mjs script selects this template when data/cases.json contains "category": "Other Use Cases".
  • Every prompt requires specifications for objective, input, quality, and output constraints, plus a mandatory dual-output request (primary + fallback).
  • Both plain-text and JSON-enhanced formats are supported for maximum compatibility with different generation agents.

Frequently Asked Questions

Where is the "Other Use Cases" template defined in the codebase?

The template is defined in docs/templates.md starting at line 11113, marked with the HTML anchor tpl-other. This block contains the plain-text skeleton and references to JSON-enhanced variations for structured prompt workflows.

How does GPT-Image2 know when to use the "other" category template?

The system checks the "category" field in data/cases.json. When it encounters "category": "Other Use Cases", the template selector in scripts/generate-site-data.mjs (lines 49-96) automatically retrieves the template associated with the tpl-other anchor. The category ID "other" is registered in data/style-library.json lines 200-203.

Can I use JSON instead of plain text for the "Other Use Cases" prompts?

Yes. The template supports a JSON-enhanced format compatible with the "JSON 进阶模板" pattern documented in docs/templates.md. This structured approach is ideal for programmatic agents that parse specific fields like quality_constraints and output_requirements rather than processing natural language prompts.

What is the difference between the primary and fallback outputs?

The template requires every prompt to request 一版主方案 + 一版备选方案 (one primary scheme plus one alternative scheme). The primary output represents the main visual concept, while the fallback provides a secondary variation—useful for A/B testing, client alternatives, or backup options when the primary rendering does not meet expectations.

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 →