image-ad-clone (KIE.ai)
Take an existing image ad and turn it into a reusable, parameterizable prompt template that gets appended to the shared 37-template image-ad library. The template is validated by round-tripping through one of the KIE.ai image-ad generators — ChatGPT Image 2 (typography / UI-mimicry templates) or Nano Banana (photoreal / lifestyle / multi-reference templates).
This skill replaces the older Uni1-locked image-ad-clone (which only worked with Luma uni-1). It's backend-agnostic: at Phase 1 the agent asks you (or auto-detects from the reference) whether to validate against gpt-image-2 or Nano Banana, then routes through the matching generator script in this repo.
Read order
- This file — KIE-specific generator paths, model-choice decision, what's locked at the per-repo layer.
- shared/skills/image-ad-clone/prompting/guide.md — the full model-agnostic 10-phase workflow.
- shared/skills/image-ad-prompting/prompting/template-format.md — entry skeleton.
- shared/skills/image-ad-prompting/prompting/prompt-library.md — destination for the new entry.
Hard rules
Inherits all 6 hard rules from the shared guide. Plus per-repo:
- Backend is one of: ChatGPT Image 2 (via KIE's dedicated
/gpt4o-image/generateendpoint) OR Nano Banana (via/jobs/createTask). Never uni-1.
Picking the right backend in Phase 1
Pick by what the reference ad is showing — most templates fall into one clear bucket.
Use chatgpt-image-ad when the reference is:
- Typography-heavy / UI mimicry (Apple Notes lists, fake Google search, fake Slack threads, ChatGPT-conversation ads, iMessage screenshots, comparison tables, fake AirDrop dialogs, Hinge-style cards, calendar UI, weather forecast UI, magazine masthead)
- Brutalist / editorial typography heros
- Dense small text inside UI elements
Use nano-banana-image-ad when the reference is:
- Photoreal handheld objects (whiteboards, napkins, sticky notes, letter boards, scratch-off tickets)
- Aspirational lifestyle photography (sunset, kitchen at golden hour, OOH / transit)
- Multi-image reference blending (logo + product + style + character all in one)
- Clay / claymation / Pixar-adjacent textures
If the reference straddles both, clone twice (once per backend) and ship the template with Model notes saying which renders cleaner. The agent offers this in Phase 8.
If the user explicitly says "clone this with gpt-image-2" or "with Nano Banana", honor that.
Dependencies
This skill uses the matching generator script in the SAME repo:
- For gpt-image-2 validation:
skills/chatgpt-image-ad/scripts/generate_image.py(hits KIE's dedicated/api/v1/gpt4o-image/generateendpoint) - For Nano Banana validation:
skills/nano-banana-image-ad/scripts/generate_image.py(hits/jobs/createTaskwithnano-banana-2/-pro/-edit)
Fail Phase 1 with a fix-it message if neither generator is installed in this repo.
Also required:
.envwithKIE_API_KEY- Reference ad image hosted at a public URL (KIE has no presigned-upload flow). The agent will stop and ask for hosting if you pass a local path with no host configured in
MASTER_CONTEXT.md. - Python 3.12+
Where this skill's generator lives
When the shared guide Phase 1 tells you to locate the companion generator, look here in order based on the model choice:
For gpt-image-2:
~/.claude/skills/chatgpt-image-ad/scripts/generate_image.py<repo>/skills/chatgpt-image-ad/scripts/generate_image.py- If neither: stop and ask the user to install
chatgpt-image-adfirst.
For Nano Banana:
~/.claude/skills/nano-banana-image-ad/scripts/generate_image.py<repo>/skills/nano-banana-image-ad/scripts/generate_image.py- If neither: stop and ask the user to install
nano-banana-image-adfirst.
Reference image hosting
KIE only accepts public URLs as references. Before any generation in this workflow:
- The reference ad image must already be at a public URL, OR
- The user has configured an image-hosting strategy in
MASTER_CONTEXT.mdunder "Image hosting" (R2 / S3 / Cloudinary / imgur / 0x0.st / etc.)
If neither, stop at Phase 1 and ask the user how to host. Record their answer in MASTER_CONTEXT.md for future runs.
The generator scripts HEAD-probe the URL before submitting; pass --skip-url-check if your host blocks HEAD requests.
Aspect ratio mapping per backend
Each KIE backend has different native aspect-ratio support. When measuring the original ad's aspect (Phase 2):
chatgpt-image-ad (KIE /gpt4o-image/generate): accepts only 1:1, 3:2, 2:3.
4:5ad → use2:3(taller; document the map)1.91:1ad → use3:29:16/16:9ads → NOT supported on this backend; consider Nano Banana for those
nano-banana-image-ad (KIE /jobs/createTask): accepts the full Meta ratio set — 1:1, 4:5, 5:4, 2:3, 3:2, 9:16, 16:9, 3:4, 4:3, 21:9. Default to 4:5 for Meta feed-portrait — KIE Nano Banana renders it natively.
If your reference ad's native ratio isn't supported by the backend you want, the choice is:
- Switch backends (most ratios work on Nano Banana)
- Render at the closest supported ratio and document the fallback in the
Aspect ratio:field - (For very narrow / very tall ads) Consider the Arcads repo's
image-ad-cloneinstead
Workflow phases (model-agnostic, see shared guide for full detail)
- Phase 1: Preflight + model choice + hosting check. Reference URL reachable;
.envhasKIE_API_KEY; both generators detected. Ask the user which model to validate against (or auto-detect from the reference). Confirm reference image is at a public URL. - Phase 2: Visual analysis. Describe the reference structurally — aspect ratio, format type, layout, typography, color palette, photography style, every text string verbatim, decorative elements, chrome to strip.
- Phase 3: Draft v1 prompt (brand-specifics intact).
- Phase 4: Generate with reference using the matching generator script. Pass
--image-url <reference_url>and the matched aspect ratio. - Phase 5: Compare and iterate. Refine prompt based on deltas. Cap 4 iterations.
- Phase 6: Generalize into placeholders.
- Phase 7: Test the generalized template against a DIFFERENT brand (need a different brand's product photo hosted at a public URL).
- Phase 8: Cross-model validation (recommended). Run the same template through the OTHER backend in this repo. Document deltas in the
Model notesblock. - Phase 9: Document the template using
template-format.md. RequiredModel notesfor both backends. - Phase 10: Save and confirm. Append to
shared/skills/image-ad-prompting/prompting/prompt-library.md.
Iteration directory layout
<cwd>/iterations/clone-2026-05-26/
T40-lifestyle-hero/
prompt.txt
v1.png, v2.png, … # against the source ref (chosen backend)
test-fill-v1.png, … # Phase 7 generalization test
cross-{other-backend}/v1.png # Phase 8 cross-model validation
notes.md
See also
- shared/skills/image-ad-clone/prompting/guide.md — full 10-phase workflow
- shared/skills/image-ad-prompting/OVERVIEW.md — ecosystem context
- chatgpt-image-ad skill — gpt-image-2 generator
- nano-banana-image-ad skill — Nano Banana generator
- kie-external-api skill — KIE conventions (async polling, URL refs, marketplace strings)