# How to Find Prompt Templates for UI Design in GPT-Image2

> Discover UI design prompt templates for GPT-Image2. Find them in docs/templates.md or data/style-library.json for enhanced creative workflows.

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

---

**GPT-Image2 stores reusable UI design prompt templates in [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) under the section `### UI与界面`, with machine-readable versions available in [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) and accessible via the built-in `gpt-image-2-style-library` skill.**

The **freestylefly/awesome-gpt-image-2** repository organizes its prompt templates for UI design across both human-readable documentation and structured JSON indices. Whether you need to copy a quick fill-in-the-blank prompt or integrate template retrieval into an automated workflow, the codebase provides three distinct access patterns optimized for different use cases.

## Locating UI Design Templates in the Documentation

The primary entry point for **prompt templates for UI design in GPT-Image2** is the comprehensive markdown guide located at [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md). This file serves as the canonical reference for all reusable prompt structures within the ecosystem.

### The Main Template Catalog

According to the repository source code, the UI-specific content resides in the `### UI与界面` section of [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md). This section begins at anchor `tpl-ui` and organizes interface generation prompts into three distinct formats designed for varying technical requirements.

The markdown file contains fill-in-the-blank templates that specify:
- Platform targets (iOS, Android, Web)
- Visual style descriptors (minimalist, tech, skeuomorphic)
- Layout structures (top navigation, two-column, card flow)
- Aspect ratio constraints (9:16, 16:9)

### Three Template Formats Available

The documentation identifies three specific template types for UI generation:

1. **Plain-text "常规模板"** – A direct copy-paste format for immediate use in chat interfaces
2. **JSON "进阶模板"** – A structured object format consumed programmatically by agents
3. **截图生成模板** – Specialized templates optimized for social-media-style screenshot generation

## Accessing Templates Programmatically

For developers building automated pipelines or custom agents, the repository provides machine-readable alternatives to the markdown documentation.

### The Style Library JSON Index

The file [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) contains a serialized index of all templates available in the system. According to the skill documentation 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), this JSON file maps template types to their structured definitions.

Entries in the JSON index include metadata such as:
- `type`: Classification identifier (e.g., "UI Screenshot")
- `platform`: Supported operating systems or display contexts
- `style`: Visual theme parameters including color palettes and typography
- `constraints`: Technical requirements like fidelity levels and aspect ratios

### Using the Built-in Skill

The repository implements a dedicated skill called `gpt-image-2-style-library` that abstracts JSON template retrieval. Agents can invoke this skill using XML-style tags in prompts to automatically populate template structures with runtime variables.

## Practical Implementation Examples

### Copy-and-Paste Plain Text Template

For immediate use without infrastructure dependencies, extract the plain-text template directly from [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md):

```text
为[产品类型]生成一张[平台，如 iOS/Android/Web]界面图。
核心功能：[功能点A]、[功能点B]、[功能点C]。
视觉风格：[极简/科技/拟物]，主色[颜色]，强调色[颜色]。
布局：[顶部导航/双栏/卡片流]，信息层级清晰，留白充足。
输出：高保真UI截图，文字清晰可读，比例[9:16/16:9]。

```

### Node.js JSON Template Retrieval

To access the structured template programmatically, parse the style library JSON as implemented in the source repository:

```javascript
// Load the style-library JSON
import fs from 'node:fs';
const lib = JSON.parse(
  fs.readFileSync(
    './data/style-library.json',
    'utf8'
  )
);

// Find the UI-Screenshot template
const uiTemplate = lib.find(
  t => t.type === 'UI Screenshot'
);

console.log('JSON UI template:', uiTemplate);

```

This script returns the JSON representation of the UI template (corresponding to lines 24-46 of [`templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/templates.md)), including all default parameters and structural schema.

### Skill-Based Template Invocation

For agents integrated with the GPT-Image2 ecosystem, invoke the built-in skill to handle template population automatically:

```text
<skill name="gpt-image-2-style-library">
{
  "type": "UI Screenshot",
  "platform": "Web",
  "product": "Dashboard",
  "layout": "Two‑column with top navigation",
  "style": {
    "theme": "Light",
    "primary_color": "Blue",
    "typography": "Sans‑serif"
  },
  "content": {
    "header": "Analytics Overview",
    "cards": [
      {"title":"Sales", "data":"$1.2M"},
      {"title":"Visitors","data":"34K"}
    ]
  },
  "constraints": "High fidelity, readable text, 16:9 aspect ratio"
}
</skill>

```

The `gpt-image-2-style-library` skill processes this input against the schema defined in [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) and returns a fully rendered prompt compatible with GPT-Image2's generation API.

## Summary

- **Primary documentation** for UI design templates resides in [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) under the `### UI与界面` section, offering both plain-text and JSON formats

- **Machine-readable index** is maintained in [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json), enabling programmatic access to template structures
- **Built-in skill** `gpt-image-2-style-library` (documented 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)) provides an abstraction layer for template retrieval and population
- **Three access modes** support varying workflows: direct copy-paste, JSON parsing, and skill-based invocation

## Frequently Asked Questions

### Where are the UI design prompt templates physically located in the repository?

The templates are stored in [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) within the `### UI与界面` section. For programmatic access, the same data is serialized in [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) and referenced by the `gpt-image-2-style-library` skill documentation located at [`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).

### What is the difference between the "常规模板" and "进阶模板" formats?

The **"常规模板"** (standard template) is a plain-text fill-in-the-blank format designed for direct copying into chat interfaces. The **"进阶模板"** (advanced template) is a JSON-structured object containing typed fields and schema definitions, intended for consumption by automated agents and the `gpt-image-2-style-library` skill.

### How do I use the templates in an automated workflow?

Import and parse [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) using Node.js or any JSON-capable runtime. Filter for entries where `type` equals "UI Screenshot" to retrieve the specific template object. Alternatively, invoke the `<skill name="gpt-image-2-style-library">` XML block with your parameters to have the system handle template selection and population automatically.

### Can I modify the existing UI templates?

Yes. The repository structure allows direct modification of [`docs/templates.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/docs/templates.md) for documentation updates and [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) for schema changes. When editing the JSON file, ensure you maintain the structure expected by the `gpt-image-2-style-library` skill to preserve compatibility with existing agent implementations.