Generate images using multiple AI models — Midjourney (via Legnext.ai), Flux, Nano Banana Pro (Gemini), Ideogram, Recraft, and more via fal.ai. Intelligently routes to the best model based on use case.
This skill generates images using the best AI model for each use case. Model selection is the most important decision — read the dispatch logic carefully before generating.
Always select the model based on the user's actual need, not just the request surface.
Does the request involve MULTIPLE images that share characters, scenes, or story continuity?
├─ YES → Use NANO BANANA (Gemini)
│ Reason: Gemini understands context holistically; supports reference_images
│ for character/scene consistency across a series (storyboard, comic, sequence)
│
└─ NO → Is it a SINGLE standalone image?
├─ Artistic / cinematic / painterly / highly detailed?
│ → Use MIDJOURNEY
│
├─ Photorealistic / portrait / product photo?
│ → Use FLUX PRO
│
├─ Contains TEXT (logo, poster, sign, infographic)?
│ → Use IDEOGRAM
│
├─ Vector / icon / flat design / brand asset?
│ → Use RECRAFT
│
├─ Quick draft / fast iteration (speed priority)?
│ → Use FLUX SCHNELL (<2s)
│
└─ General purpose / balanced?
→ Use FLUX DEV
| Model | ID | Artistic | Photorealism | Text | Context Continuity | Speed | Cost |
|---|---|---|---|---|---|---|---|
| Midjourney | midjourney | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐ | ❌ (no context) | ~30s | ~$0.05 |
| Nano Banana Pro | nano-banana | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ~20s | $0.15 |
| Flux Pro | flux-pro | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ❌ | ~5s | ~$0.05 |
| Flux Dev | flux-dev | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐ | ❌ | ~8s | ~$0.03 |
| Flux Schnell | flux-schnell | ⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ❌ | <2s | ~$0.003 |
| Ideogram v3 | ideogram | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ❌ | ~10s | ~$0.08 |
| Recraft v3 | recraft | ⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐ | ❌ | ~8s | ~$0.04 |
| SDXL Lightning | sdxl | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ❌ | ~3s | ~$0.01 |
Use Nano Banana whenever the user's request involves:
Nano Banana uses Google's Gemini 3 Pro multimodal architecture, which understands context holistically rather than keyword-matching. It supports up to 14 reference images for maintaining character and scene consistency.
exec tool with sufficient timeout.node {baseDir}/generate.js \
--model <model_id> \
--prompt "<enhanced prompt>" \
[--aspect-ratio <ratio>] \
[--num-images <1-4>] \
[--negative-prompt "<negative prompt>"] \
[--reference-images "<url1,url2,...>"]
Parameters:
--model: One of midjourney, flux-pro, flux-dev, flux-schnell, sdxl, nano-banana, ideogram, recraft--prompt: The image generation prompt (required)--aspect-ratio: e.g. 16:9, 1:1, 9:16, 4:3, 3:4 (default: 1:1)--num-images: 1-4 (default: 1; Midjourney always returns 4 regardless)--negative-prompt: Things to avoid (not supported by Midjourney)--reference-images: Comma-separated image URLs for context/character consistency (Nano Banana only)--mode: Midjourney speed: turbo (default, ~20-40s), fast (~30-60s), relax (free but slow)exec timeout: Set at least 120 seconds for Midjourney and Nano Banana; 30 seconds is sufficient for Flux Schnell.
Always use sync mode (no --async). The script waits internally until complete.
node {baseDir}/generate.js \
--model midjourney \
--prompt "<enhanced prompt>" \
--aspect-ratio 16:9
{
"success": true,
"model": "midjourney",
"jobId": "xxxxxxxx-...",
"imageUrl": "https://cdn.legnext.ai/temp/....png",
"imageUrls": [
"https://cdn.legnext.ai/mj/xxxx_0.png",
"https://cdn.legnext.ai/mj/xxxx_1.png",
"https://cdn.legnext.ai/mj/xxxx_2.png",
"https://cdn.legnext.ai/mj/xxxx_3.png"
]
}
CRITICAL — image field meanings:
| Field | What it is | When to use |
|---|---|---|
imageUrl | A 2×2 grid composite of all 4 images | Send as preview so user can see all options |
imageUrls[0] | Image 1 (top-left) | Send when user wants image 1 |
imageUrls[1] | Image 2 (top-right) | Send when user wants image 2 |
imageUrls[2] | Image 3 (bottom-left) | Send when user wants image 3 |
imageUrls[3] | Image 4 (bottom-right) | Send when user wants image 4 |
"放大第N张" / "要第N张" / "give me image N" = send imageUrls[N-1] directly. Do NOT call generate.js again.
After generation:
🎨 生成完成!这是 4 张图的预览: 预览图 你喜欢哪一张?回复 1、2、3 或 4,我直接发给你高清单图。
When user picks image N:
这是第 N 张的单独高清图: 图片 N
Use for storyboards, character series, and any context-dependent multi-image generation.
node {baseDir}/generate.js \
--model nano-banana \
--prompt "<detailed scene description>" \
--aspect-ratio 16:9
node {baseDir}/generate.js \
--model nano-banana \
--prompt "<scene description, referencing the character/style from the reference images>" \
--aspect-ratio 16:9 \
--reference-images "https://url-of-previous-image-1.png,https://url-of-previous-image-2.png"
How to build a storyboard series:
--reference-images for the second frameExample storyboard workflow:
Frame 1: node generate.js --model nano-banana --prompt "A young girl with red hair, wearing a blue dress, sitting under a magical treehouse in an enchanted forest, warm golden light, storybook illustration style" --aspect-ratio 16:9
Frame 2: node generate.js --model nano-banana --prompt "The same red-haired girl in blue dress climbing the rope ladder up to the treehouse, excited expression, enchanted forest background, same storybook illustration style" --aspect-ratio 16:9 --reference-images "<frame1_url>"
Frame 3: node generate.js --model nano-banana --prompt "Inside the magical treehouse, the red-haired girl discovers a glowing book on a wooden shelf, wonder on her face, warm candlelight, same storybook illustration style" --aspect-ratio 16:9 --reference-images "<frame1_url>,<frame2_url>"
{
"success": true,
"model": "nano-banana",
"images": ["https://v3b.fal.media/files/...png"],
"imageUrl": "https://v3b.fal.media/files/...png"
}
Send imageUrl directly to the user (no grid, single image).
Best for photorealistic standalone images. Output format same as Nano Banana (single imageUrl).
node {baseDir}/generate.js --model flux-pro --prompt "<prompt>" --aspect-ratio 16:9
Best for images containing text (logos, posters, signs).
node {baseDir}/generate.js --model ideogram --prompt "A motivational poster with text 'DREAM BIG' in bold typography, sunset gradient background" --aspect-ratio 3:4
Best for vector-style, icons, flat design.
node {baseDir}/generate.js --model recraft --prompt "A minimal flat design app icon, blue gradient, abstract geometric shape" --aspect-ratio 1:1
For Midjourney: Add cinematic lighting, ultra detailed, --v 7, --style raw. Legnext supports all MJ parameters.
For Nano Banana: Use natural language descriptions. Describe the character consistently across frames (hair color, clothing, expression). Mention "same style as reference" or "consistent with previous frame".
For Flux: Add masterpiece, highly detailed, sharp focus, professional photography, 8k.
For Ideogram: Be explicit about text content, font style, layout, and color scheme.
For Recraft: Specify vector illustration, flat design, icon style, minimal.
User: "帮我画一只赛博朋克猫" → Single artistic image → Midjourney → Tell user "🎨 正在用 Midjourney 生成,约 30 秒..." → Send grid preview, ask which one they want
User: "帮我生成一套分镜图,讲述一个女孩在魔法森林的冒险" → Multiple frames with story continuity → Nano Banana → Tell user "🎨 这类有上下文关联的分镜图用 Gemini 生成,能保持角色一致性..." → Generate frame by frame, using previous frames as reference images
User: "要第2张" / "放大第2张" (after Midjourney generation)
→ Send imageUrls[1] directly. No need to call generate.js again.
User: "做一个 App 图标,蓝色系扁平风格" → Vector/icon → Recraft
User: "生成一张带有'欢迎光临'文字的门牌图" → Text in image → Ideogram
User: "快速生成个草稿看看效果" → Speed priority → Flux Schnell (<2s)
User: "生成一张产品海报,白色背景,一瓶香水" → Photorealistic product → Flux Pro
| Variable | Description |
|---|---|
FAL_KEY | fal.ai API key (for Flux, Nano Banana, Ideogram, Recraft) |
LEGNEXT_KEY | Legnext.ai API key (for Midjourney) |