Image generation
Images made for a product are props with a job (an app card, a share image, a plate the camera moves across), not posters.
Model ids churn monthly: check references/models.md dates and the vendor changelog before a new project.
Step 0: read every file before the first action
This skill is loaded whole, never in part. Read this SKILL.md to the end, then every file in the table below, each to
its last line: no offset/limit, no head, grep or skimming, no "only the sections this task needs". If a read comes
back truncated, keep reading until the file ends. The task decides what you apply, never what you read; the table says
where each topic lives, not which files to skip. This holds when the skill is called on its own, from video-director, or
by a sub-agent. If the context is summarised mid-task, read the set again before the next action that depends on it.
| Topic | File |
|---|---|
| Prompt anatomy, the style suffix, edit prompts, negatives per model, style recipes by format | references/prompting.md |
| OpenAI API facts (models, sizes, quality, background, masks, cost), the model chooser | references/models.md |
| Cast sheets, descriptor strings, drift checks, palette locking, style across a set | references/consistency.md |
| Sizes and overscan, light continuity, layers, cutouts, sharpness, image-to-video keyframes | references/motion-assets.md |
| Reviewing your own images, failure table, brief-to-handoff workflow, cost control | references/review.md |
| Ownership, indemnity, people, disclosure, provenance | references/legal.md |
| Script flags, the prompts-file schema, other providers' keys | scripts/README.md |
Ten rules
- Generate at the final aspect, with margin for any camera move, one subject per file when it moves independently, and never with text, logos or UI painted in. Leave surfaces that will carry real text blank ("the card is plain white with nothing on it") and composite the real thing in code.
- Lock a style suffix once (medium, construction, palette names with hex values, light direction, "no text, no logos, no border") and append it verbatim to every prompt. Only the subject block varies. Version it if it must change.
- Cast first. One approved character sheet on a plain background; every scene is an edit that passes the sheet as Image 1 with each character's locked descriptor string repeated word for word. Never route identity through earlier scene images or rejects.
- Describe observable choices (camera height, lens feel, light direction, materials, counts, gaze, who holds what), never "epic, cinematic, stunning, 8k". Mood becomes light and colour; prestige becomes physical detail.
- Disambiguate by physical traits, not names: "a plump hen sitting, small red comb, clearly a hen and not a rooster" fixed a rooster. State gender for gendered nouns; models defaulted "teacher" and "doctor" to women.
- Say what you want first, then name the specific intrusion ("no lettering on the sign"). On models without negative support (FLUX, Gemini) write positives only. A constraint that keeps failing gets stated three ways.
- Cutouts: native alpha only on a model that documents it today (gpt-image-2.5 family with no backdrop words in the prompt), otherwise pure white with "no floor shadow" and matte with BiRefNet (grey or green backdrop when the subject has white in it). Verify alpha in code; review over a saturated colour, never over white.
- Draft cheap (low quality, many variants, a contact sheet), finalise expensive only for picks. Keep every version and a sidecar with the exact prompt, model, size and references.
- Review like a hostile art director: contact sheet first, then zoom on hands, faces, stray text, palette drift, scale between characters, light direction. A pretty image that misses the brief fails. Vision judges hallucinate defects: crop and check the pixels before acting.
- Generated imagery is never evidence: no real people, no generated product renders passed off as photos, no fake screenshots or events. Real product = real screenshots and photos, composited. Never name living artists or trademarked characters. For children's products, check provider terms (the Gemini API terms bar apps likely to be used by minors).
Workflow
- Brief: delivery sizes, shot or asset list with each image's job (plate, cutout, keyframe, card), style references, surfaces that will carry real text.
- Explore: 3 to 4 style directions, each one suffix applied to the same two test subjects, low quality, several variants, one labelled contact sheet; pick with the owner.
- Lock: suffix (versioned), palette, light direction, backdrop line; approve the cast sheet (and a prop or set sheet) at high quality.
- Batch from a prompts file, references first, 2 to 4 requests in flight, never overwriting.
- Review (
review.mdchecklist), then fix: edit when composition and identity are right and one local thing is wrong (one change per edit, restate what to preserve); regenerate when composition, identity or style is wrong, or after two failed edits; make pixel-exact fixes by compositing in code. - Cut out and QA edges at 200% over a saturated colour.
- Hand off trimmed PNGs with a manifest of native size and anchor point; keep prompts next to the images.
Scripts
Paths: scripts live in this skill's scripts/ folder, under the base directory shown when the skill loads (~/.claude/skills/image-generation/ for a standard install; a plugin install puts it elsewhere). The other skills of this suite sit next to it as sibling folders. Paths written as ~/.claude/skills/... below assume the standard install.
uv scripts with --help and --dry-run; keys from OPENAI_API_KEY (other providers in scripts/README.md) or
--env-file. Path: ~/.claude/skills/image-generation/scripts/. Full flags and the prompts-file schema:
scripts/README.md; a product-neutral example prompts file: assets/image_prompts.example.json.
gen_image.py PROMPTS.json [NAMES...] [--out public/img] [--provider openai|gemini|bfl|recraft] [--model ID] [--quality Q]
[--final|--draft] [--aspect 16:9|9:16|1:1|4:5] [--overscan F] [--composite-back] [--regenerate] [--concurrency 2]
[--budget USD] [--batch] [--contact-sheet PNG] [--env-file PATH] [--dry-run]
gen_image.py pick NAME LETTER [--dir public/img]
gen_image.py contact-sheet IMAGES... --out PNG
gen_image.py check-alpha IMAGES...
gen_image.py batch-fetch BATCH_ID [--out public/img]
cutout.py IMAGES... [--out-dir DIR] [--check-dir DIR] [--backdrop auto|#RRGGBB] [--erode PX] [--feather PX] [--margin 12] [--json]
- Defaults:
gpt-image-2.5-flarefor drafts,--final=gpt-image-2.5-sunburstat high quality;--draft= low quality, 4 variants at ~1 MP intodrafts/, thenpick NAME bpromotes one.gpt-image-1is refused from 2026-10-23. background: transparentis sent only to the 2.5 family and the output is checked for real alpha (kept but marked FAIL if missing); backdrop words in the prompt or style override the parameter. Otherwise white (orgrey,green,color:#hex,nonefor plates) andcutout.py.- References as
{"ref": "cast", "role": "identity and outfits"}write the "Image N: …" lines for you, identity first;edit_ofiterates on a previous output. Masks apply to Image 1 (white = edit) and are guidance only:--composite-backmakes the edit pixel-exact. - Every output gets a sidecar (prompt, model, size, references with hashes, usage, request id, cost, style hash); the script
warns when a set mixes style hashes. Moderation blocks are never retried; 429/5xx are.
--batchhalves the price for large non-urgent sets. - The Gemini, FLUX and Recraft adapters follow the vendors' documented formats but haven't been run live: check the first real result by hand. Gemini and FLUX take positive prompts only. Recraft supports text-to-image only here.
cutout.pyauto-detects the backdrop, removes the white halo by edge-colour decontamination, warns when the subject shares the backdrop colour or has enclosed holes, skips matting for files that already have alpha, and writes review copies over violet#8342C9.