utility

image-gen

Image generation across 10 AI models via a smart router — text overlay, photorealism, design assets, reference-guided, batch editing.

AI ImageMulti-ModelSmart Router
image-gen
Bundle
1.14MB
Files
5

Install

claude plugin install image-gen --from https://fadaly.net/downloads/skills/image-gen.zip

The skill

Image Generation — 10 AI Models via Smart Router

What It Does

Generates images using 10 AI models with automatic model selection based on use case. Supports text-in-image, photorealism, design assets, background removal, reference-guided generation, batch editing, and prompt validation.

Engine API (programmatic)

const imageGen = require('./engine');

// Smart router — tries models in priority order
const res = await imageGen.generateBest({ prompt, imageType: 'hero', outputDir: './out', namePrefix: 'hero' });
// Returns: { ok: true, data: { images: [...], model_used, cost_usd }, meta: { skill, command, duration_ms } }

// Direct provider calls
await imageGen.generateImagen({ prompt, outputDir, namePrefix });
await imageGen.generateOpenAI({ prompt, outputDir, namePrefix, quality: 'high' });
await imageGen.generateFal({ prompt, outputDir, namePrefix, model: 'fal-ai/flux-2-pro' });

// Reference-guided
await imageGen.generateWithRef({ prompt, referenceImages: ['./ref.png'], outputDir });

// Editing
await imageGen.editImage({ imagePath: './in.png', instruction: 'Make it watercolor' });
await imageGen.removeBackground({ imagePath: './in.png' });

// Validation
imageGen.validatePrompt({ prompt, imageType: 'hero' }); // score 0-10

CLI (backward compatible)

node <home>/projects/tools/pantheon/cli/provision.js imagen-best --prompt "<p>" --type hero --output <dir> --name <prefix>
node provision.js imagen-openai --prompt "<p>" --output <dir>
node provision.js imagen-fal --prompt "<p>" --model <fal-model-id> --output <dir>
node provision.js imagen-ref --prompt "<p>" --ref <image> [--strength 0.7] --output <dir>
node provision.js imagen-edit --image <path> --instruction "<edit>"
node provision.js remove-bg --image <path> [--output <path>]
node provision.js validate-prompt --prompt "<p>" [--type hero]

Smart Router — Image Types

TypePriority Models
heroGPT Image 1 → Flux 2 Pro → Seedream 4.5 → Flux Ultra → Imagen 4
cardSeedream 4.5 → Flux Ultra → Flux 2 Pro → GPT Image 1 → Imagen 4
productGPT Image 1 → Seedream 4.5 → Flux Ultra → Imagen 4
assetRecraft V3 → Recraft V4 → Ideogram 3.0 → GPT Image 1
textIdeogram 3.0 → Recraft V3 → GPT Image 1
draftFlux 2 Turbo → Imagen 4
textureImagen 4 → Flux 2 Turbo

Models & Costs

ModelCostBest For
GPT Image 1$0.08Text overlay, photorealism
Flux 2 Pro$0.03General high-quality
Flux 2 Turbo$0.008Fast drafts
Flux Pro Ultra$0.05Maximum quality
Ideogram 3$0.06Text in images
Recraft V3/V4$0.06Design assets
Imagen 4$0.04Google’s latest
Seedream 4.5$0.04Artistic styles
Flux 2 Flex$0.03Reference-guided
BiRefNet v2$0.005Background removal

Critical Rules

  1. NEVER use editImage for background removal — Gemini renders checkerboard, not alpha. ALWAYS use removeBackground.
  2. Every function returns { ok, data, error, meta } — the universal result contract.
  3. At least ONE API key (GEMINI, OPENAI, or FAL) must be set for healthCheck to pass.

Env Vars

  • GEMINI_API_KEY — Google Gemini/Imagen (optional)
  • OPENAI_API_KEY — OpenAI GPT Image (optional)
  • FAL_KEY — fal.ai Flux/Recraft/Ideogram/BiRefNet (optional)