The Six Blocks Used to Build a Final GPT-Image2 Prompt: A Complete Guide
The six blocks used to build a final GPT-Image2 prompt are Subject and task, Composition and layout, Visual style and materials, Text and label requirements, Aspect ratio and output format, and Constraints and negative details.
The freestylefly/awesome-gpt-image-2 repository provides a structured framework for generating production-ready prompts for OpenAI's GPT-Image2 model. Understanding the six blocks used to build a final GPT-Image2 prompt is essential for developers seeking consistent, high-quality image generation across various use cases. This systematic approach, defined in the skill's workflow documentation, ensures that every prompt covers subject matter, technical specifications, and quality constraints.
Breaking Down the Six Blocks Used to Build a Final GPT-Image2 Prompt
According to the source code in agents/skills/gpt-image-2-style-library/SKILL.md (lines 28-34), the GPT-Image2 skill assembles production-ready prompts by concatenating these six distinct sections:
- Subject and task – Defines what the image should depict and the purpose it serves.
- Composition and layout – Specifies how elements are arranged, such as rule of thirds or grid layouts.
- Visual style and materials – Determines the aesthetic, textures, colors, and artistic medium.
- Text and label requirements – Outlines required typography, captions, or annotations.
- Aspect ratio and output format – Sets target dimensions (e.g., 16:9, square) and file types.
- Constraints and negative details – Establishes specific limits and elements to avoid, such as watermarks or heavy advertising language.
Subject and Task
This foundational block establishes the core content and objective of the image generation request. It answers what the image should depict and identifies the primary purpose or narrative function. For example, defining a "futuristic city skyline at dusk" provides the AI with the central thematic focus.
Composition and Layout
This section determines the spatial arrangement and structural organization of visual elements. Specifications such as "wide-angle view, foreground with a river, city reflected in water" guide the model's rendering of depth, perspective, and visual hierarchy using techniques like the rule of thirds or grid systems.
Visual Style and Materials
Here you specify the artistic direction and physical qualities of the image. This includes lighting conditions (e.g., "cinematic lighting"), color palettes ("neon accents"), and rendering techniques ("high-detail 3D rendering"). The data/style-library.json file contains reference data for selecting appropriate style templates for this block.
Text and Label Requirements
Critical for images requiring specific typography or annotations, this block defines any textual elements needed. Specifications like "no overlaid text, clean sky, subtle logo placement" ensure the generated image meets branding or readability standards without unexpected textual artifacts.
Aspect Ratio and Output Format
This block handles technical parameters such as "aspect ratio 16:9, high-resolution PNG". It establishes the dimensional constraints and file format requirements necessary for the intended use case, whether for web display, print media, or social media platforms.
Constraints and Negative Details
The final block acts as quality control, preventing unwanted elements through explicit exclusion criteria. Phrases like "avoid watermarks, no text in Chinese characters, no crowding" filter out common generation artifacts and ensure the output adheres to specific content restrictions.
Implementing the Six-Block Structure in Code
The freestylefly/awesome-gpt-image-2 repository demonstrates how to construct these prompts programmatically. As implemented in the codebase, you can concatenate the six blocks into a final string ready for the GPT-Image2 API:
// Example: constructing a prompt with the six blocks
const prompt = [
// 1. Subject & task
"A futuristic city skyline at dusk, showcasing eco‑friendly architecture",
// 2. Composition & layout
"wide‑angle view, foreground with a river, city reflected in water",
// 3. Visual style & materials
"cinematic lighting, neon accents, high‑detail 3D rendering",
// 4. Text & label requirements
"no overlaid text, clean sky, subtle logo placement",
// 5. Aspect ratio & output format
"aspect ratio 16:9, high‑resolution PNG",
// 6. Constraints & negative details
"avoid watermarks, no text in Chinese characters, no crowding"
].join("\n");
// Resulting prompt ready for the GPT‑Image2 API
console.log(prompt);
Key Files in the Repository Architecture
Several files work together to support this six-block prompt architecture:
agents/skills/gpt-image-2-style-library/SKILL.md– Defines the skill workflow and enumerates the six prompt blocks at lines 28-34.data/style-library.json– Stores the style-library data referenced when selecting templates and tags for the visual style block.scripts/generate-site-data.mjs– Generates the site's case data and links to prompt examples.src/main.jsx– Front-end entry point that invokes the skill to produce prompts dynamically.
Summary
- The six blocks used to build a final GPT-Image2 prompt provide a standardized framework ensuring comprehensive prompt coverage.
- These blocks are formally defined in
agents/skills/gpt-image-2-style-library/SKILL.mdat lines 28-34. - Subject and task establishes the core content, while Composition and layout controls spatial arrangement and perspective.
- Visual style and materials defines aesthetic qualities, and Text and label requirements handles typography and annotation needs.
- Aspect ratio and output format specifies technical parameters for delivery, and Constraints and negative details filters unwanted elements through explicit exclusions.
- The repository provides JavaScript implementations in files like
src/main.jsxthat concatenate these blocks into API-ready prompt strings.
Frequently Asked Questions
What are the six blocks used to build a final GPT-Image2 prompt?
The six blocks are Subject and task, Composition and layout, Visual style and materials, Text and label requirements, Aspect ratio and output format, and Constraints and negative details. These are defined in the SKILL.md file of the awesome-gpt-image-2 repository and ensure comprehensive prompt coverage for consistent image generation.
Where are the six prompt blocks defined in the awesome-gpt-image-2 repository?
The six blocks are explicitly defined in agents/skills/gpt-image-2-style-library/SKILL.md at lines 28-34. This file serves as the canonical reference for the GPT-Image2 skill's workflow structure and prompt assembly logic.
How do I implement the six-block prompt structure in my own code?
You can implement the structure by creating an array containing six strings representing each block, then joining them with newline characters. The repository's src/main.jsx demonstrates this pattern using JavaScript's join("\n") method to produce the final prompt string for the GPT-Image2 API, as shown in the implementation examples above.
What is the purpose of the Constraints and negative details block?
This final block acts as a quality control mechanism, specifying elements to exclude from the generated image such as watermarks, specific languages, or crowded compositions. It helps prevent common unwanted artifacts in GPT-Image2 outputs by explicitly stating negative constraints that the model should avoid during generation.
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 →