Skip to content
/imagegenOfficial

Generate and edit images using the OpenAI Image API with structured prompt augmentation.

AIOpenAIImagesCreativeΒ· 2 min read

Quick import: Download the .md file and save it to .claude/commands/ (Claude Code), .cursorrules (Cursor), or paste as a system prompt in ChatGPT, Gemini, or any LLM API.

#What it does

The imagegen skill generates and edits images using the OpenAI Image API. It classifies requests into taxonomy categories (product shots, UI mockups, concept art, background edits, etc.), augments prompts into structured specs, and runs the bundled CLI for deterministic, reproducible image generation.

#How to use

bash
$imagegen
Generate or edit images for this task and return the final prompt plus selected outputs.

#Decision tree

  • User provides an input image or says "edit/retouch/inpaint/mask" -- edit
  • User needs many different prompts/assets -- generate-batch
  • Otherwise -- generate

#Workflow

  1. Decide intent -- Generate vs edit vs batch
  2. Collect inputs -- Prompt(s), exact text, constraints, input images/masks
  3. Classify -- Map to a taxonomy slug (see categories below)
  4. Augment prompt -- Reformat into a structured spec without inventing new requirements
  5. Run CLI -- Execute scripts/image_gen.py with sensible defaults
  6. Inspect and validate -- Check subject, style, composition, text accuracy
  7. Iterate -- Single targeted change, re-run, re-check
  8. Save -- Return final outputs with the prompt and flags used

#Taxonomy categories

Generate:

  • photorealistic-natural -- Candid/editorial lifestyle scenes
  • product-mockup -- Product/packaging shots, catalog imagery
  • ui-mockup -- App/web interface mockups
  • infographic-diagram -- Diagrams with structured layout and text
  • logo-brand -- Logo/mark exploration
  • illustration-story -- Comics, narrative scenes
  • stylized-concept -- Style-driven concept art, 3D renders
  • historical-scene -- Period-accurate scenes

Edit:

  • text-localization -- Translate/replace in-image text
  • identity-preserve -- Try-on, person-in-scene
  • precise-object-edit -- Remove/replace a specific element
  • lighting-weather -- Time-of-day/atmosphere changes
  • background-extraction -- Transparent background / clean cutout
  • style-transfer -- Apply reference style
  • compositing -- Multi-image merge
  • sketch-to-render -- Line art to photoreal

#Prompt template

Use case: <taxonomy slug>
Asset type: <where the asset will be used>
Primary request: <user's main prompt>
Style/medium: <photo/illustration/3D/etc>
Composition/framing: <wide/close/top-down>
Lighting/mood: <lighting + mood>
Text (verbatim): "<exact text>"
Constraints: <must keep/must avoid>

#Environment

  • OPENAI_API_KEY must be set for live API calls
  • Python packages: openai, pillow

This skill is from the OpenAI Skills Catalog.

OpenAIΒ·
View all skills