Based on freestylefly/awesome-gpt-image-2(⭐18k+, MIT) industrial-grade prompt engine methodology, distilled into an executable workflow for constructing image-generation prompts.
Task Objective
- This skill is used to: transform vague image-generation requirements into structured prompts that GPT-Image-2 can execute stably.
- Capabilities include:
- Atomic Schema decomposition: seven major dimensions: Subject / Composition / Material / Typography / Lighting / Style / Constraints
- 20+ industrial-grade JSON templates: covering scenarios such as UI screenshots, infographics, posters, e-commerce main images, brand visuals, commercial photography, character IP, ancient-book Chinese style, narrative illustration, etc.
- Four-step workflow: choose category → retrieve cases (copy structure) → apply template and fill variables → generate and iterate with image-to-image
- 5 stability-tested techniques: text locking, aspect ratio first, module quantity limits, platform feature differentiation, negative constraints
- Trigger conditions:
- ✅ E-commerce main images/detail pages, movie/event posters, infographics/knowledge graphs, brand visuals, UI screenshots, commercial photography, character/IP design, narrative illustration, ancient-book Chinese style, 3D rendering
- ❌ Random image generation, simple landscape photos, casual drawings that do not require precise control → use basic image_generation
Core Methodology: Prompt as Code
Universal Structural Formula
[主体与任务] + [构图与布局] + [视觉风格与材质] + [文字与标签要求] + [比例与输出格式] + [约束与负向细节]
Atomic Schema
| Dimension | Field | Description | Example |
|---|---|---|---|
| Subject | Subject | The core object of the image; the more specific, the better | "A 30ml transparent glass perfume bottle with a gold cap" |
| Composition | Composition | Layout, viewpoint, shot size | "Centered symmetry, 45-degree top-down shot, shallow depth of field" |
| Material | Material | Surface texture and tactile feel of the object | "Frosted glass, metallic reflection, condensation droplets" |
| Typography | Typography | Text content, font, and position in the image | "Title 'Limited-Time Offer', bold sans-serif, upper-left corner" |
| Lighting | Lighting | Light source direction, color temperature, atmosphere | "Soft side backlight, warm tones, Tyndall effect" |
| Style | Style | Overall visual tone | "High-end commercial photography, minimalist white background, 8K" |
| Constraints | Constraints | Negative prompts and hard limits | "No garbled text, no extra fingers, 9:16" |
Four-Step Workflow
Step 1: Choose Category
Match the template category based on user needs:
| Category | Template ID | Applicable Scenario |
|---|---|---|
| UI and Interface | ui-screenshot-system |
App screenshots, dashboards, social media screenshots, livestream interfaces |
| Charts and Information Visualization | infographic-engine |
Explanatory diagrams, technical diagrams, timelines, knowledge cards |
| Scientific Scale Diagrams | scientific-scale-diagram |
Scale progression diagram from micro to macro |
| Posters and Typography | poster-campaign |
Event posters, movie posters, conceptual typography posters |
| E-commerce Main Images | ecommerce-hero |
Product main images, detail page banners, sales images |
| Brand Visuals | brand-identity |
Brand KV, VI applications, packaging design |
| Commercial Photography | commercial-photo |
Product still life, portraits, food photography |
| Characters and IP | character-design |
Character design, IP mascot, sticker packs |
| Narrative Illustration | narrative-illustration |
Story scenes, picture books, editorial illustration |
| Ancient Books and Chinese Style | classical-chinese |
Chinese painting, gongbi, ink wash, Dunhuang style |
Step 2: Retrieve cases (copy the structure)
Use scripts/query_templates.py to retrieve templates and cases from the local cloned repository:
python3 scripts/query_templates.py --category ecommerce
python3 scripts/query_templates.py --keyword "香水 海报"
When the repository is not cloned, the script degrades gracefully and outputs online raw links:
- Template library:https://raw.githubusercontent.com/freestylefly/awesome-gpt-image-2/main/docs/templates.md
- Gallery Part 1:https://raw.githubusercontent.com/freestylefly/awesome-gpt-image-2/main/docs/gallery-part-1.md
- Gallery Part 2:https://raw.githubusercontent.com/freestylefly/awesome-gpt-image-2/main/docs/gallery-part-2.md
You can also directly web_fetch the above links to get the latest cases.
Step 3: Apply the template and fill in variables
Select the matching JSON template and fill the user requirements into the variables. The following are 3 core template examples:
Template A: Infographic
{
"type": "Infographic",
"topic": "<主题,明确具体>",
"audience": "<目标读者>",
"structure": {
"title_area": "<主标题>",
"layout": "<布局描述,如:等距切角,N个编号面板>",
"modules": [
{"title": "<模块1>", "icon": "<图标名>", "text": "<1-2句说明>"},
{"title": "<模块2>", "icon": "<图标名>", "text": "<1-2句说明>"}
]
},
"style": {
"aesthetic": "<风格,如:科学图鉴/扁平插画/商务报告>",
"colors": "<配色方案>",
"background": "<背景>"
},
"constraints": "No gibberish text, strict structural layout, <比例>"
}
Template B: Movie/Event Poster
{
"type": "Poster",
"subject": "<主体描述>",
"title": {
"text": "<标题,必须精确显示>",
"style": "<字体风格,如:粗黑体/书法体/衬线体>",
"position": "<位置,如:居中/底部/对角>"
},
"composition": "<构图描述>",
"visual_style": "<视觉风格,如:赛博朋克/复古胶片/极简>",
"color_palette": ["<主色>", "<辅色>", "<点缀色>"],
"mood": "<情绪关键词>",
"constraints": "Title must be spelled exactly, readable text, <比例>, no random text"
}
Template C: E-commerce Main Image
{
"type": "Ecommerce",
"product": {
"name": "<产品名>",
"material": "<材质>",
"color": "<颜色>",
"key_feature": "<核心卖点>"
},
"scene": "<使用场景/背景>",
"composition": "<构图,如:居中45度俯拍>",
"lighting": "<光线描述>",
"style": "<风格,如:高端商业摄影/极简白底/生活方式>",
"text_overlay": {
"headline": "<主文案>",
"subtext": "<副文案>",
"position": "<位置>"
},
"constraints": "Product must be accurate, readable text, <比例>, no watermark"
}
Step 4: Generate and iterate
- Convert the filled JSON into a natural language prompt
- Call
image_generationto generate the image (use Chinese prompts for Chinese requirements, English for English) - Check the generated result: whether the text is accurate, whether the composition matches, whether the ratio is correct
- If not satisfied, adjust the corresponding Schema dimensions and regenerate (image-to-image mode can pass in a reference image)
5 Practical Tips for Stability
- Text locking: whenever there is text in the image, you must write "the text must accurately display the specified content, garbled text and placeholder text are prohibited", and write out the original text word for word
- Aspect ratio upfront: write the aspect ratio at the very beginning of the prompt or as the first item in constraints, otherwise the model defaults to 1:1 or 9:16
- Module limit: for infographics, lock in 3-5 modules first before adding details; too many modules will inevitably cause chaos
- Platform feature differentiation: UI screenshots must specify the platform (iOS/Android/Xiaohongshu/Douyin); status bars, Tabs, and interactive elements differ greatly across platforms
- Make negative constraints specific: do not just write "no artifacts"; write "no extra fingers", "no garbled buttons", "no product deformation"
How to Use
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
| category | string | Yes | Image category: ui/infographic/poster/ecommerce/brand/photo/character/narrative/classical |
| subject | string | Yes | Subject description |
| style | string | No | Visual style preference |
| aspect_ratio | string | No | Aspect ratio (default 1:1) |
| text_content | string | No | Text that needs to be displayed in the image |
| reference_image | string | No | Reference image path/URL (image-to-image mode) |
| extra_constraints | string | No | Additional constraints |
Output
- A structured GPT-Image-2 prompt (ready to copy and use)
- The corresponding JSON Schema (reusable/batch-modifiable)
- The selected template name and reference case ID
- Negative constraint checklist
Resource references
- Upstream project:freestylefly/awesome-gpt-image-2(⭐18k+,MIT License)
- Online gallery:https://gpt-image2.canghe.ai
- npm package:
gpt-image-2-style-library - Full template library:
references/style-library.md(detailed index of 20+ templates) - Case library: 530+ reverse-engineering cases, see upstream
docs/gallery.md
⚠️ Reminder on commercial licensing for third-party cases: The cases referenced by this skill are for learning and reference only. Before commercial use, please confirm the licensing scope of the corresponding case.
Notes
- This skill does not add an image generation tool; generating images still requires calling the
image_generationskill - Chinese requests output Chinese prompts by default, and English requests output English prompts
- During batch generation, reuse the same template and only change subject / composition / palette
- If repository cloning is blocked by a 403, prioritize retrieving via online raw links as the main path