Skip to content

Guide · Agent skill

How to use the GPT Image 2 agent skill (gpt-image-2)

Updated · written with AI from the project's own documentation and checked against our catalogue data

The gpt-image-2 skill gives an AI agent structured prompt templates for GPT Image 2, covering posters, UI mockups, product visuals, infographics, academic figures and more. It can also generate or edit images directly when an OpenAI-compatible API key is configured. This guide explains what the skill does, how to install it, how to trigger it with plain requests, and what it needs to run.

GPT Image 2 GeneratorConardLi/garden-skills · MIT

Quick start

  1. 1Download and unzip. Download the ZIP from this skill's page and unzip it into ~/.claude/skills/ or your project's .claude/skills/ folder. Confirm the scripts folder is present.
  2. 2Run the mode check. Run node skills/gpt-image-2/scripts/check-mode.js to see whether you are in Mode A, B or C.
  3. 3Set variables for Garden mode (optional). For direct image generation, set ENABLE_GARDEN_IMAGEGEN=1 and OPENAI_API_KEY. Skip this if your host has its own image tool.
  4. 4Make a request. Describe the image in plain language and answer the agent's questions about missing fields such as subject, text or price.
  5. 5Review the prompt or image. In Mode A, check the saved image in garden-gpt-image-2/image/. In Modes B and C, review the prompt in garden-gpt-image-2/prompt/ before using it.

What is an agent skill, and what does this one do?

An agent skill is a folder of instructions and optional scripts that an AI agent loads when a task matches the skill. This one is defined in a SKILL.md file and is focused on two image tasks: generating images (POST /images/generations) and editing images (POST /images/edits).

The skill's main value is structure. Instead of writing a vague request like 'make a poster', the agent picks a matching template from its library, asks you for the fields that matter, and renders a detailed final prompt. The library is organised into categories such as UI mockups, product visuals, maps, slides and academic figures, with individual Markdown template files under references/.

  • Poster, UI mockup, product and e-commerce visuals
  • Infographics, academic figures and technical architecture diagrams
  • Comics, avatars, process boards, film storyboards and IP merchandise
  • Editing workflows for existing images

Install the gpt-image-2 skill

Download the ZIP from the skill's page in this directory. Then choose one of the following methods.

For a personal install, unzip the folder into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

The commands in SKILL.md refer to skills/gpt-image-2/scripts/, so check that the scripts folder landed inside the skill folder after unzipping. The file list for this package does not show a scripts/ folder, so confirm it is present in your download before relying on Garden mode.

  • Personal: ~/.claude/skills/
  • Project: .claude/skills/ inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Understand the three runtime modes

The first thing the skill does is detect which mode it is running in. It runs check-mode.js, which reports mode A, A? or B-or-C with a recommendation. Run it yourself to see what your setup supports.

Mode A (Garden local generation) needs the ENABLE_GARDEN_IMAGEGEN variable set to 1, true, yes or on, plus an OPENAI_API_KEY. The agent then calls generate.js or edit.js and saves files locally. Mode B (Host-Native) applies when Garden is off but the host agent has its own image tool; the skill supplies the prompt and the host renders the image. Mode C (Advisor) applies when there is no image tool at all; the skill writes the final prompt for you to paste into another image tool.

  • Mode A: Garden switch on and API key present. Scripts generate and save images.
  • Mode B: Garden off, host has an image tool. The host renders from the skill's prompt.
  • Mode C: Garden off, no image tool. You get a reusable prompt saved to garden-gpt-image-2/prompt/.
  • A? : Garden switch on but no API key. Add the key first.
node skills/gpt-image-2/scripts/check-mode.js node skills/gpt-image-2/scripts/check-mode.js --json

Configure the environment variables

The scripts read settings in this order: CLI arguments, process environment, <cwd>/.env, <cwd>/.gateway.env, then ~/.gateway.env. OPENAI_BASE_URL defaults to https://api.openai.com/v1 and can point to a compatible third-party gateway. OPENAI_IMAGE_MODEL defaults to gpt-image-2 and can be changed to a model your gateway supports, such as gpt-image-1 or dall-e-3.

Only ENABLE_GARDEN_IMAGEGEN and OPENAI_API_KEY are needed for basic Mode A use. Modes B and C do not need an API key.

  • ENABLE_GARDEN_IMAGEGEN: mode switch (1, true, yes or on)
  • OPENAI_API_KEY: required for Mode A only
  • OPENAI_BASE_URL: default https://api.openai.com/v1
  • OPENAI_IMAGE_MODEL: default gpt-image-2
ENABLE_GARDEN_IMAGEGEN=1 OPENAI_API_KEY=your-key-here

Trigger the skill with natural requests

You do not need special syntax. Describe the image you want in plain language and name the type of visual if you know it, for example a poster, a UI mockup or a diagram for a paper. The agent should match the request to a template and ask follow-up questions for missing essentials.

The templates expect specific details. A live-commerce UI template, for instance, asks who the host is (a real photo, a named celebrity, a described person, or random generation), and a product template asks for the product name and whether a price should be set. Answer those questions directly, or say 'you choose' to let the agent fill defaults.

  • 'Make a product poster for my cold brew coffee, minimal style, white background.'
  • 'Draft a graphical abstract for my paper: problem, method, key process, result.'
  • 'Edit assets/source.png and replace the background with a clean studio scene.' (Mode A)
  • 'Give me a prompt for a landing page hero. I will paste it into my own image tool.' (Mode C)

Run the scripts (Mode A examples)

In Mode A, the agent runs generate.js for text-to-image and edit.js for changes to an existing image. Adding a mask file lets you edit only part of the picture. If you do not give an output path, images and prompts are saved in the workspace under garden-gpt-image-2/prompt/ and garden-gpt-image-2/image/, with a task name and timestamp in the file name.

  • Prompts go to garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md
  • Images go to garden-gpt-image-2/image/<task-slug>-<timestamp>.png
  • Use --prompt-output or --image/--output to choose your own paths
node skills/gpt-image-2/scripts/generate.js --prompt "A cute baby sea otter" --size 1024x1024 --quality high node skills/gpt-image-2/scripts/edit.js --image assets/source.png --mask assets/mask.png --prompt "Replace only the masked area with a glass vase"

What people use it for

  • A designer drafts a consistent set of poster prompts with the same layout fields each time.
  • A marketer creates a live-commerce UI mockup or an e-commerce main image from a structured template.
  • A researcher drafts a graphical abstract or method pipeline figure from a short description of the paper.
  • A student gets a clean academic diagram prompt to paste into another image tool.

Frequently asked questions

Is the gpt-image-2 skill free to use?

The source does not state a price or licence fee for the skill itself beyond its MIT licence. Generating images in Garden mode uses an OpenAI or compatible API, which bills separately under that provider's terms.

What do I need to run it?

Node.js is needed to run check-mode.js, generate.js and edit.js. Garden mode also needs an OPENAI_API_KEY (or an OpenAI-compatible gateway key) and ENABLE_GARDEN_IMAGEGEN set. Without those, you can still use Host-Native or Advisor mode.

Can I use it without an API key?

Yes, but not for direct image output. If your host agent has an image tool, the skill hands it the prompt (Mode B). If not, it writes a prompt you can paste into another image tool (Mode C).

Why does the agent only write a prompt and not an image?

That is Mode C. Without the Garden switch and an image tool, the skill cannot render images, so it saves a ready-to-use prompt and tells you to run it in your own tool.

Does the skill run code on my computer?

Yes. It runs Node.js scripts and uses the network to call the image API in Mode A. Review the scripts and the API endpoint you configure before running them, and keep your key in an env file you control.

Can it create images of real people or celebrities?

The templates allow it, for example a livestream host can be a named celebrity. Check likeness and consent before publishing any image of a real person.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you make posters, UI mockups, product shots or academic figures often and want consistent, detailed prompts, especially if you have an OpenAI-compatible key or a host image tool. Pick something else if you need guaranteed image output with no API key or image tool, or if you need factually verified visuals, since the templates do not check accuracy.

Download the skill