Illustration and Art Prompt Templates for GPT-Image2: A Complete Guide
The freestylefly/awesome-gpt-image-2 repository defines two distinct prompt templates for GPT-Image2 generation: a plain-text template for manual input located at docs/templates.md anchor tpl-illustration, and a structured JSON template for programmatic agent control.
The GPT-Image2 skill relies on carefully structured prompting to generate high-quality illustrations. According to the source code in freestylefly/awesome-gpt-image-2, the system splits visual generation into two complementary approaches: human-readable text prompts and machine-parseable JSON schemas. Both templates are maintained in docs/templates.md and consumed by the agent skill defined in agents/skills/gpt-image-2-style-library/SKILL.md.
The Plain-Text Illustration Template
The Illustration Template provides a fill-in-the-blanks format optimized for quick experimentation and manual prompt entry. This template uses Chinese placeholders to define visual parameters.
The template structure in docs/templates.md follows this pattern:
创作[题材]插画,主角为[角色/主体]。
画风:[日漫/水彩/扁平/厚涂],线条:[细腻/粗犷]。
配色:[配色方案],背景:[简洁/复杂场景]。
构图:[近景/中景/远景],重点表现[细节]。
输出:可用于封面或社媒发布的高质量插画。
Key placeholders include:
- [题材] - Subject or theme (e.g., sci-fi city, fantasy forest)
- [画风] - Art style (anime, watercolor, flat, oil painting)
- [线条] - Line work quality (fine/detailed or bold/rough)
- [配色方案] - Color palette
- [构图] - Composition (close-up, mid-shot, wide shot)
This format is ideal for rapid iteration when testing GPT-Image2 capabilities directly through the interface.
The JSON Artistic Illustration Template
For programmatic usage and agent-driven calls, the repository provides a structured JSON template. This format explicitly separates each visual attribute, enabling input validation and constraint enforcement.
The JSON schema defined in docs/templates.md uses the following structure:
{
"type": "Artistic Illustration",
"art_style": "Studio Ghibli inspired anime style",
"scene": {
"description": "A giant flying whale carrying a small cozy village on its back",
"details": "Windmills turning, tiny people looking over the edge, fluffy white clouds"
},
"palette": "Vibrant sky blue, lush greens, soft pastel accents",
"technique": "Cel shading, detailed background art, soft glowing magical aura",
"mood": "Whimsical, adventurous, nostalgic"
}
Required fields include:
type- Must be set to"Artistic Illustration"to trigger the correct rendering pipelineart_style- Specific aesthetic direction (e.g., "Cyberpunk neon aesthetic")scene.description- Primary subject matterscene.details- Fine-grained visual elementspalette- Color scheme specificationtechnique- Rendering approach (e.g., "Cel shading", "Oil painting texture")mood- Emotional tone of the output
Implementing GPT-Image2 Prompts in Code
The api/generate-image.js endpoint accepts either format through distinct payload structures. Here are the implementation patterns for both templates.
Text-Based API Implementation
When using the plain-text template, pass the formatted string to the prompt field:
const payload = {
prompt: `创作科幻城市插画,主角为未来飞行车。画风:厚涂,线条:细腻。配色:蓝紫渐变,背景:高楼天际线。构图:远景,重点表现光线反射。输出:高质量社媒海报。`
};
fetch('/api/generate-image', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
})
.then(res => res.blob())
.then(blob => {
const img = document.createElement('img');
img.src = URL.createObjectURL(blob);
document.body.appendChild(img);
});
The prompt field directly accepts the illustration template's placeholder-filled string, allowing the GPT-Image2 model to interpret the visual parameters from natural language context.
JSON-Based API Implementation
For agent-driven generation, wrap the JSON template in a jsonPrompt field:
const payload = {
jsonPrompt: {
"type": "Artistic Illustration",
"art_style": "Studio Ghibli inspired anime style",
"scene": {
"description": "A giant flying whale carrying a small cozy village on its back",
"details": "Windmills turning, tiny people looking over the edge, fluffy white clouds"
},
"palette": "Vibrant sky blue, lush greens, soft pastel accents",
"technique": "Cel shading, detailed background art, soft glowing magical aura",
"mood": "Whimsical, adventurous, nostalgic"
}
};
fetch('/api/generate-image', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
})
.then(res => res.blob())
.then(blob => {
const img = document.createElement('img');
img.src = URL.createObjectURL(blob);
document.body.appendChild(img);
});
Using jsonPrompt ensures type-safe parameter passing and enables backend validation against the schema defined in SKILL.md.
Dynamic Template Selection
To support runtime template switching, implement a builder function that routes to the appropriate format:
function buildPrompt(type, data) {
if (type === 'text') {
return `创作${data.theme}插画,主角为${data.hero}。画风:${data.style},线条:${data.line}。配色:${data.palette},背景:${data.background}。构图:${data.composition},重点表现${data.focus}。输出:高质量插画。`;
} else {
return {
type: "Artistic Illustration",
art_style: data.style,
scene: { description: data.sceneDesc, details: data.sceneDetails },
palette: data.palette,
technique: data.technique,
mood: data.mood
};
}
}
This utility allows the GPT-Image2 skill to accept user preferences and format them appropriately for either manual or automated workflows.
Skill Architecture and Integration
The GPT-Image2 Style Library skill (agents/skills/gpt-image-2-style-library/SKILL.md) orchestrates template consumption. It validates incoming requests against the JSON schema for programmatic calls or sanitizes text prompts for the plain-text template. The skill ensures that parameters like art_style and technique map to valid generation options supported by the underlying model.
Summary
- Two template formats exist in
docs/templates.md: a plain-text Chinese template for manual entry and a JSON schema for programmatic control. - Text templates use the
promptfield in API calls and support rapid experimentation with visual parameters like 画风 (art style) and 配色 (color palette). - JSON templates use the
jsonPromptfield with explicit keys:art_style,scene,palette,technique, andmood. - Implementation flexibility allows dynamic switching between formats using builder functions that route to
api/generate-image.js.
Frequently Asked Questions
What is the difference between the text and JSON templates in GPT-Image2?
The text template (tpl-illustration) is a human-readable format with Chinese placeholders for quick manual entry, while the JSON template provides machine-readable structure with explicit keys for art_style, palette, and mood for automated agent integration.
Where are the prompt templates defined in the repository?
The templates are defined in docs/templates.md under the tpl-illustration anchor. The skill interface that consumes these templates is documented in agents/skills/gpt-image-2-style-library/SKILL.md.
Can I mix Chinese and English content in the prompt templates?
Yes. The plain-text template uses Chinese structural markers (创作, 画风, 配色) but accepts English content within the brackets. The JSON template accepts any language in its string values.
Which template should I use for programmatic image generation?
Use the JSON Artistic Illustration template for programmatic usage. It provides type safety through structured fields like scene.description and technique, making it easier to validate inputs and maintain consistent outputs in automated workflows.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →