跳到主要内容

图片生成

生成通用图片/纹理资产(非精灵):概念图、参考图、UI 背景、海报、横幅等。输出 PNG 自动导入为 Texture2D(Default 类型),默认保存到 Assets/TJGenerators/History/

开始

从GUI开始

菜单:AI > 生成 > 生成图片,或参考 生成3D模型 的开始部分。

从CLI开始

使用 generate_image 工具生成图片。图片是普通资产,默认不需要放入场景——产出后按路径引用即可。

输入模式:

模式参数说明
文生图prompt纯文字描述
图生图prompt + image_path参考图 + 文字指导

⚠️ prompt 参数始终必填,即使提供了参考图。图生图时若用户未给描述,应先读取参考图内容再写出 prompt


模型

图片生成提供 3 种模型,通过 generator_id 选择:

Frontier Game Design(默认模型)

  • generator_id: frontier-game-design(默认)
  • 适用场景: 游戏化图片、概念图,自带游戏提示词模板
  • 关键参数:
    • prompt(必填)/ image_path
    • imageSizesquare_hd(默认)/ square / portrait_4_3 / portrait_16_9 / landscape_4_3 / landscape_16_9
    • outputFormatpng(默认)/ jpeg
    • prompt_templategame_icon(游戏图标)/ concept_art(概念设计)/ ""(默认无模板)

火山 SeeDream Image

  • generator_id: huoshan_seedream_image(用户说"用火山模型"/"用SeeDream"时切换)
  • 适用场景: 通用文生图/图生图,支持像素级尺寸控制与自动背景去除
  • 关键参数:
    • prompt(必填)/ image_path
    • size:输出尺寸(默认 2048x2048,2K/4K 共 15 种预设)
    • is_segmentation:是否自动去除背景(默认 true,背景/纹理类应设 false)
    • q_value:抠图后压缩质量 1–100(默认 75)
    • resize_width:输出最大宽度(px),0 = 不缩放

Frontier(风格化特效)

  • generator_id: frontier-effect
  • 适用场景: 在参考图上做风格化/艺术化特效,支持比例控制
  • 关键参数:
    • prompt(必填)/ image_path
    • resolution0.5K / 1K(默认)/ 2K / 4K
    • aspect_ratioauto(默认)/ 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 5:4 / 4:5 / 21:9
    • output_formatpng(默认)/ jpeg

模型选择决策

场景选择
通用图片/概念图/游戏图标(默认)Frontier Game Design
游戏特定提示词模板(game_icon / concept_art)Frontier Game Design + prompt_template
需要像素级尺寸或自动背景去除SeeDream(huoshan_seedream_image
在参考图上做风格化特效 / 需要特定宽高比Frontier(frontier-effect
需要 JPEG 输出Frontier(output_format)或 Game Design(outputFormat

输出尺寸(size,仅 SeeDream)

2K:2048x2048(默认)、2304x17281728x23042560x14401440x25602496x16641664x24963024x1296; 4K:4096x40964704x35203520x47045504x30403040x55044992x33283328x4992


优化

提示词优化

  • 具体描述场景和元素"a fantasy castle on a cliff overlooking a stormy sea, dramatic lighting" > "a castle"
  • 指定画面风格"oil painting style" / "photorealistic" / "anime style"
  • Frontier Game Design 可用 prompt_template 自动加上游戏化前缀
  • SeeDream 支持中文提示词,但英文通常更稳定

尺寸与分辨率

  • SeeDream 最小尺寸约 1920×1920,过小的尺寸后端会自动放大;若仍报 400,请用预设 size
  • Frontier 低分辨率(0.5K/1K) 适合快速预览,2K/4K 适合最终产出
  • 选择合适宽高比避免裁剪:UI 横幅用 16:9,图标用 1:1

背景分割

  • 需要透明背景的精灵(游戏图标/道具图)→ 使用 generate_sprite 而非 generate_image
  • generate_imageis_segmentation(仅 SeeDream)适合概念图去背景,但产出类型是 Texture2D 而非 Sprite

并行生成

  • 最大 5 个并发任务

注意事项

  • ⚠️ 默认模型是 Frontier Game Designsize / is_segmentation / q_value / resize_width 仅 SeeDream 有效resolution / aspect_ratio 仅 Frontier 有效imageSize / outputFormat / prompt_template 仅 Game Design 有效
  • ⚠️ prompt 始终必填,即使提供了 image_path
  • ⚠️ SeeDream 最小尺寸约 1920×1920,请求更小尺寸可能触发 400 错误
  • ⚠️ Image ≠ Sprite:Image 产出为 Texture2D,适合概念图/背景/海报;Sprite 产出为 Sprite 类型,适合游戏图标/道具——需求不同请选对应工具
  • ⚠️ 默认不放入场景:图片是普通资产,除非用户明确要求,否则只产出并按路径引用
  • ⚠️ 生成耗时 30–90 秒
  • ⚠️ 输出路径:默认 Assets/TJGenerators/History/
  • ⚠️ Domain Reload:生成期间不要在磁盘写入 .cs 文件