From generate-image
Generate images for websites, presentations, and marketing materials using AI models on Replicate (Nano Banana 2, FLUX Schnell) with optional background removal for transparent PNGs. Use this skill whenever the user asks to create, generate, or make images, illustrations, icons, hero images, OG images, logos, favicons, or any visual asset. Also use when implementing issues that require visual assets, or when the user says "generate an image", "create an illustration", "make me an icon", "I need a visual for...", "remove background", "make transparent", or references image generation in any context. If a project needs visual assets and you're about to use placeholder text/emoji instead, use this skill to generate real assets.
How this skill is triggered — by the user, by Claude, or both
Slash command
/generate-image:generate-imageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate production-ready visual assets using AI models on Replicate. Handles model selection, prompt engineering, background removal, and file management.
Generate production-ready visual assets using AI models on Replicate. Handles model selection, prompt engineering, background removal, and file management.
Before proceeding, verify you have tools available starting with mcp__replicate__. If not, tell the user: "Replicate MCP not detected. Run /generate-image:setup to configure it." and stop.
No AI image model generates true transparency. When a transparent background is needed, always use a two-step pipeline: generate the image with Nano Banana 2 (on a solid white background), then remove the background with recraft-ai/recraft-remove-background. This pipeline is automatic — do not ask the user whether to remove the background when transparency is requested or implied (icons, illustrations, logos).
Models last verified: 2026-04-05. If a model ID returns an error, check Replicate for the current model name and file an issue at 3D-Stories/generate-image.
| Model | ID | Best For | Cost | Speed |
|---|---|---|---|---|
| Nano Banana 2 | google/nano-banana-2 | Icons, illustrations, complex scenes, text in images, high quality | ~$0.04/image | ~20s |
| FLUX Schnell | black-forest-labs/flux-schnell | Quick iterations, drafts, bulk low-cost generation | ~$0.003/image | ~0.5s |
| Background Remover | recraft-ai/recraft-remove-background | Transparent PNGs from any image | ~$0.01/image | ~5s |
Nano Banana 2: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1
FLUX Schnell: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 9:21
| Use Case | Aspect Ratio | Model Notes |
|---|---|---|
| Icon / Favicon source | 1:1 | Both models |
| Hero image | 16:9 | Both models |
| OG image (social) | 21:9 | Generate at 21:9, crop to 1200x630 |
| Instagram post | 1:1 | Both models |
| Instagram story | 9:16 | Both models |
| Twitter/X header | 21:9 | Closest to 3:1; crop if needed |
| App store screenshot | 9:16 | Both models |
| Email header | 21:9 | Closest to 3:1; crop if needed |
| Tall banner | 1:4 | NB2 only |
For use cases needing ratios not in the supported list, generate at the closest supported ratio and crop to the target dimensions.
Before generating, look for style-guide.md in the project root. If it exists, read it and incorporate the style directives (colors, visual style, mood) into your prompts. If it doesn't exist and this is the first generation for the project, suggest creating one with /superpowers:brainstorm.
Build prompts in layers. The background color choice is critical for later bg removal:
"on solid white background" — white backgrounds produce dramatically cleaner bg removal than black. Black backgrounds cause dark halos and artifacts around edges.Template:
[Style]. [Subject with specific details]. On solid white background. [Color hex references]. Clean minimal design suitable for [size]px display. [Constraints]. Centered.
Example:
Flat vector illustration icon on solid white background. A golden trophy cup with two handles on a pedestal, gold hex fbbf24 with subtle highlights. Clean minimal flat design suitable for 64px display. No text, no border, centered.
Use mcp__replicate__create_models_predictions:
Nano Banana 2:
model_owner: "google"
model_name: "nano-banana-2"
Prefer: "wait"
input: {"prompt": "...", "aspect_ratio": "1:1", "number_of_images": 1}
FLUX Schnell:
model_owner: "black-forest-labs"
model_name: "flux-schnell"
Prefer: "wait"
input: {"prompt": "...", "num_outputs": 1, "aspect_ratio": "1:1", "output_format": "png"}
Recraft Remove Background:
model_owner: "recraft-ai"
model_name: "recraft-remove-background"
Prefer: "wait"
input: {"image": "https://..."}
The image input accepts any HTTP URL — including Replicate output URLs from a prior generation step. This means you can chain generation -> bg removal without downloading/re-uploading.
Download each output URL with curl -sL.
/generate-image:setup), model temporarily unavailable (try again in a minute), malformed input (check parameter names and types).<id> returned no output. Check status at replicate.com/predictions/."When the user requests a transparent background — or when the use case implies it (icons, illustrations, logos) — this step runs automatically after generation. Do not ask the user; just do it.
originals/ subdirectoryimage input (no re-upload needed):
mcp__replicate__create_models_predictions:
model_owner: "recraft-ai"
model_name: "recraft-remove-background"
Prefer: "wait"
input: {"image": "<GENERATION_OUTPUT_URL>"}
curl -sLFor existing local images (not from a prior generation), upload first using mcp__replicate__create_files, then pass the returned URL as the image input to bg removal.
For batch processing, launch all bg removal MCP calls in parallel — they complete in ~5s each.
When to skip bg removal (opaque background is intentional):
Determine the output directory:
*.png, *.svg, *.jpg). If found, use the most common parent directory — this respects the project's established conventions.public/images/, assets/images/, static/images/, src/assets/images/. Use the first that exists.Save files:
originals/ subdirectory within the chosen output directory (before bg removal)icon-gold-coin.png, hero-phone-mockup.pngGenerated: <output-path>/icon-gold-coin.png
Model: google/nano-banana-2 + recraft-ai bg removal
Prompt: [prompt used]
Size: [file size]
Background: transparent
| Use Case | Model | Background | BG Removal | Aspect Ratio | Post-Processing |
|---|---|---|---|---|---|
| Icon | NB2 | White | Yes | 1:1 | — |
| Hero image | NB2 | Scene bg | No | 16:9 | — |
| OG image | NB2 | Designed bg | No | 21:9, crop to 1200x630 | — |
| Section illustration | NB2 | White | Yes | 16:9 | — |
| Logo cleanup | — | — | Yes (existing image) | 1:1 | — |
| Quick draft | FLUX | White | Optional | 1:1 | — |
| Favicon | NB2 | White | Yes | 1:1 | ICO conversion (see below) |
After generating and bg-removing a favicon source image, convert to multi-size ICO format.
Check for available conversion tools in this order:
Pillow — check: python3 -c "from PIL import Image"
python3 -c "
from PIL import Image
img = Image.open('favicon.png')
img.save('favicon.ico', format='ICO', sizes=[(16,16),(32,32),(48,48),(64,64),(128,128),(256,256)])
"
ImageMagick — check: convert --version
convert favicon.png -define icon:auto-resize=256,128,64,48,32,16 favicon.ico
Neither available — tell the user: "ICO conversion requires Pillow (pip install Pillow) or ImageMagick (apt install imagemagick). Install one and re-run."
For multiple related assets (icon sets, etc.):
originals/ subdirectoryThis skill also handles removing backgrounds from existing images (logos, photos, user-provided assets). The same recraft-ai/recraft-remove-background model works on any image:
mcp__replicate__create_files (provides an HTTP URL for the file)mcp__replicate__create_models_predictions with model_owner: "recraft-ai", model_name: "recraft-remove-background", Prefer: "wait", and input: {"image": "<FILE_URL>"}curl -sLCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub 3d-stories/generate-image --plugin generate-image