网淘吧来吧,欢迎您!

Image Gen

2026-03-31 新闻来源:网淘吧 围观:16
电脑广告
手机广告

图像生成技能

此技能根据每种使用场景选择最佳的AI模型来生成图像。模型选择是最重要的决策——请在生成前仔细阅读调度逻辑。


🧠 智能调度逻辑

始终根据用户的实际需求而非表面请求来选择模型。

Image Gen

决策树

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

模型能力矩阵

模型ID艺术性写实性文本处理上下文连续性速度成本
Midjourneymidjourney⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐❌ (无上下文)约30秒约0.05美元
Nano Banana Pronano-banana⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐约20秒0.15美元
Flux Proflux-pro⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐约5秒约0.05美元
Flux Devflux-dev⭐⭐⭐⭐⭐⭐⭐⭐⭐约8秒约0.03美元
Flux Schnellflux-schnell⭐⭐⭐⭐⭐⭐⭐<2秒约$0.003
Ideogram v3ideogram⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐约10秒约$0.08
Recraft v3recraft⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐约8秒约$0.04
SDXL Lightningsdxl⭐⭐⭐⭐⭐⭐⭐⭐约3秒约$0.01

何时使用Nano Banana(关键)

使用Nano Banana当用户的请求涉及:

  • 故事板 / 分镜图:包含相同角色的多帧叙事图像
  • 连环漫画:具有连贯角色的连续画格
  • 角色系列:同一人物/角色在不同姿势或场景中的多张图像
  • 场景延续:“现在展示同一个女孩在森林里”(需引用前序图像)
  • 风格一致性:必须保持相同视觉风格/世界观的一组图像

Nano Banana采用谷歌Gemini 3 Pro多模态架构,能够整体理解上下文而非关键词匹配。它支持最多14张参考图像以维持角色和场景的一致性。


如何使用此功能

  1. 分析请求:是单张图像还是系列图像?是否需要上下文连续性?
  2. 选择模型:使用上述决策树。
  3. 增强提示词:添加适合该模型的风格、光照和品质描述符。
  4. 通知用户:告知他们您正在使用哪个模型及原因,并说明生成已开始。
  5. 运行脚本:使用exec工具并设置充足的超时时间。
  6. 交付结果:将图像URL发送给用户。

调用生成脚本

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,...>"]

参数:

  • --model:从midjourneyflux-proflux-devflux-schnell中选择一个。sdxlnano-bananaideogramrecraft
  • --prompt:图像生成提示(必需)
  • --aspect-ratio:例如16:91:19:164:33:4(默认:1:1
  • --num-images:1-4(默认:1;Midjourney 无论设置如何总是返回4张)
  • --negative-prompt: 需要避免的内容(Midjourney不支持)
  • --reference-images: 用于保持上下文/角色一致性的逗号分隔的图片URL(仅限Nano Banana
  • --mode: Midjourney速度模式:turbo(默认,约20-40秒),fast(约30-60秒),relax(免费但速度慢)

exec timeout: 对于Midjourney和Nano Banana,请至少设置为120秒;对于Flux Schnell,30秒即可。


⚡ Midjourney 工作流程(同步模式 — 不使用 --async)

始终使用同步模式(不使用--async)。脚本会在内部等待直至任务完成。

node {baseDir}/generate.js \
  --model midjourney \
  --prompt "<enhanced prompt>" \
  --aspect-ratio 16:9

理解 Midjourney 输出

{
  "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"
  ]
}

重要 — 图像字段含义:

字段含义使用场景
imageUrl一个2×2网格组合图包含全部4张图像作为预览图发送,以便用户查看所有选项
imageUrls[0]图像1(左上角)当用户需要图像1时发送
imageUrls[1]图像2(右上角)当用户需要图像2时发送
imageUrls[2]图像3(左下角)当用户需要图像3时发送
imageUrls[3]图像4(右下角)当用户需要图像4时发送

"放大第N张" / "要第N张" / "give me image N" = 发送对应图像图片地址[N-1]直接使用。请勿再次调用生成脚本。

Midjourney 交互流程

生成完成后:

🎨 生成完成!这是 4 张图的预览:预览图你喜欢哪一张?回复 1、2、3 或 4,我直接发给你高清单图。

当用户选择第 N 张图片时:

这是第 N 张的单独高清图:图片 N


🤖 Nano Banana (Gemini) 工作流程

适用于故事板、角色系列以及任何依赖于上下文的多图像生成。

单张图片(无参考)

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"

如何构建故事板系列:

  1. 生成第一帧不使用参考图片(建立角色/场景)
  2. 将第一帧的图片地址用作--reference-images参数来生成第二帧
  3. 对于后续帧,使用最近的1-3张图像作为参考以保持一致性
  4. 在所有提示中保持角色描述一致

示例故事板工作流程:

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>"

Nano Banana 输出

{
  "success": true,
  "model": "nano-banana",
  "images": ["https://v3b.fal.media/files/...png"],
  "imageUrl": "https://v3b.fal.media/files/...png"
}

发送imageUrl直接给用户(无网格,单张图片)。


其他模型

Flux Pro / Dev / Schnell

最适合写实风格的独立图像。输出格式与Nano Banana相同(单个imageUrl)。

node {baseDir}/generate.js --model flux-pro --prompt "<prompt>" --aspect-ratio 16:9

Ideogram v3

最适合包含文字的图像(徽标、海报、标志)。

node {baseDir}/generate.js --model ideogram --prompt "A motivational poster with text 'DREAM BIG' in bold typography, sunset gradient background" --aspect-ratio 3:4

Recraft v3

最适合矢量风格、图标、平面设计。

node {baseDir}/generate.js --model recraft --prompt "A minimal flat design app icon, blue gradient, abstract geometric shape" --aspect-ratio 1:1

提示词增强技巧

对于Midjourney:添加电影感灯光超精细细节,--v 7,--style raw. Legnext 支持所有 MJ 参数。

对于 Nano Banana:使用自然语言描述。跨帧保持角色描述的一致性(发色、服装、表情)。提及“与参考图风格相同”或“与前一帧保持一致”。

对于 Flux:添加杰作高度细节锐利焦点专业摄影8k

对于 Ideogram:明确说明文本内容、字体风格、布局和配色方案。

对于 Recraft:指定矢量插画扁平设计图标风格极简.示例对话用户: "帮我画一只赛博朋克猫" → 单一艺术图像 →


Midjourney

→ 告诉用户 "🎨 正在用 Midjourney 生成,约 30 秒..." → 发送网格预览,询问他们想要哪一张用户: "帮我生成一套分镜图,讲述一个女孩在魔法森林的冒险" → 具有故事连续性的多帧画面 →Nano Banana

→ 告诉用户 "🎨 这类有上下文关联的分镜图用 Gemini 生成,能保持角色一致性..." → 一帧一帧地生成,使用之前的帧作为参考图像用户: "要第2张" / "放大第2张" (Midjourney 生成后) → 直接发送imageUrls[1]

。无需再次调用 generate.js。用户: "做一个 App 图标,蓝色系扁平风格" → 矢量/图标 →directly. No need to call generate.js again.

User: "做一个 App 图标,蓝色系扁平风格" → Vector/icon →Recraft

用户: "生成一张带有'欢迎光临'文字的门牌图" → 图片中的文字 →Ideogram

用户: "快速生成个草稿看看效果" → 速度优先 →Flux Schnell(<2秒)

用户: "生成一张产品海报,白色背景,一瓶香水" → 照片级真实产品 →Flux Pro


环境变量

变量描述
FAL_KEYfal.ai API密钥(用于Flux, Nano Banana, Ideogram, Recraft)
LEGNEXT_KEYLegnext.ai API密钥(用于Midjourney)

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第349313名访客 今日有175篇新文章/评论