godot-asset-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Godot Asset Generator

Godot 游戏资产生成器

Generate game assets using AI image generation APIs and prepare them for use in Godot 4.x. This skill covers the complete art pipeline from concept to Godot-ready sprites.
使用AI图像生成API生成游戏资产,并为在Godot 4.x中使用做好准备。本技能涵盖从概念设计到可直接用于Godot的精灵图的完整美术工作流。

When to Use This Skill

适用场景

Use this skill when:
  • Generating game sprites, characters, or objects using AI
  • Creating tilesets for platformers or top-down games
  • Generating UI elements, icons, or menu assets
  • Batch-generating animation frames
  • Preparing AI-generated assets for Godot import
  • Creating consistent asset sets with style guides
Do NOT use this skill when:
  • Creating 3D models or textures (2D assets only)
  • Manual pixel art or illustration (use art software)
  • Complex frame-by-frame animation (use animation tools)
  • Working with existing assets (use Godot directly)
在以下场景使用本技能:
  • 使用AI生成游戏精灵图、角色或物件
  • 为平台游戏或俯视角游戏创建tileset
  • 生成UI元素、图标或菜单资产
  • 批量生成动画帧
  • 为Godot导入准备AI生成的资产
  • 创建风格统一的资产集
请勿在以下场景使用本技能:
  • 创建3D模型或纹理(仅支持2D资产)
  • 手动绘制像素画或插画(使用专业美术软件)
  • 复杂的逐帧动画(使用动画制作工具)
  • 处理已有资产(直接使用Godot)

Prerequisites

前置要求

Required:
  • Deno runtime installed
  • At least one API key:
    • OPENAI_API_KEY
      for DALL-E 3
    • REPLICATE_API_TOKEN
      for Replicate (SDXL, Flux)
    • FAL_KEY
      for fal.ai
Optional:
  • ImageMagick for advanced image processing
  • Godot 4.x project for import file generation
必需项
  • 已安装Deno运行时
  • 至少拥有一个API密钥:
    • OPENAI_API_KEY
      (用于DALL-E 3)
    • REPLICATE_API_TOKEN
      (用于Replicate,支持SDXL、Flux)
    • FAL_KEY
      (用于fal.ai)
可选项
  • ImageMagick(用于高级图像处理)
  • Godot 4.x项目(用于生成导入文件)

Quick Start

快速开始

Generate a Single Image

生成单张图像

bash
deno run --allow-env --allow-net --allow-write scripts/generate-image.ts \
  --provider dalle \
  --prompt "pixel art knight character, front view, 16-bit style, transparent background" \
  --output ./assets/knight.png
bash
deno run --allow-env --allow-net --allow-write scripts/generate-image.ts \
  --provider dalle \
  --prompt "pixel art knight character, front view, 16-bit style, transparent background" \
  --output ./assets/knight.png

Batch Generate Animation Frames

批量生成动画帧

bash
deno run --allow-env --allow-net --allow-read --allow-write scripts/batch-generate.ts \
  --spec ./batch-spec.json \
  --output ./generated/
bash
deno run --allow-env --allow-net --allow-read --allow-write scripts/batch-generate.ts \
  --spec ./batch-spec.json \
  --output ./generated/

Create Sprite Sheet

创建精灵图集

bash
deno run --allow-read --allow-write scripts/pack-spritesheet.ts \
  --input ./generated/*.png \
  --output ./sprites/player-sheet.png \
  --columns 4
bash
deno run --allow-read --allow-write scripts/pack-spritesheet.ts \
  --input ./generated/*.png \
  --output ./sprites/player-sheet.png \
  --columns 4

Core Workflow

核心工作流

Phase 1: Style Definition

阶段1:风格定义

Define your art style before generating assets:
  1. Choose Art Style: Pixel art, hand-drawn, painterly, or vector
  2. Create Style Guide: Document colors, modifiers, and constraints
  3. Test Prompts: Generate samples to validate style consistency
json
{
  "style": "pixel-art",
  "resolution": 64,
  "palette": "limited-16-colors",
  "modifiers": "16-bit, no anti-aliasing, clean pixels"
}
在生成资产前定义你的美术风格:
  1. 选择美术风格:像素画、手绘、油画风或矢量图
  2. 创建风格指南:记录色彩、修饰词和约束条件
  3. 测试提示词:生成样例以验证风格一致性
json
{
  "style": "pixel-art",
  "resolution": 64,
  "palette": "limited-16-colors",
  "modifiers": "16-bit, no anti-aliasing, clean pixels"
}

Phase 2: Asset Generation

阶段2:资产生成

Generate assets using the appropriate provider:
  1. Single Assets: Use
    generate-image.ts
    for individual images
  2. Batch Assets: Use
    batch-generate.ts
    for multiple related assets
  3. Iterate: Refine prompts based on results
使用合适的服务商生成资产:
  1. 单个资产:使用
    generate-image.ts
    生成单张图像
  2. 批量资产:使用
    batch-generate.ts
    生成多个相关资产
  3. 迭代优化:根据结果调整提示词

Phase 3: Post-Processing

阶段3:后期处理

Prepare raw AI output for game use:
  1. Background Removal: Extract sprites from backgrounds
  2. Color Correction: Normalize palette if needed
  3. Resize: Scale to exact game resolution
  4. Trim/Pad: Remove whitespace, add sprite padding
bash
deno run --allow-read --allow-write scripts/process-sprite.ts \
  --input ./raw/knight.png \
  --output ./processed/knight.png \
  --remove-bg \
  --resize 64x64 \
  --filter nearest
将AI生成的原始输出调整为适合游戏使用的格式:
  1. 移除背景:将精灵图从背景中提取出来
  2. 色彩校正:如有需要,统一调色板
  3. 调整尺寸:缩放至游戏所需的精确分辨率
  4. 裁剪/补边:移除空白区域,为精灵图添加边距
bash
deno run --allow-read --allow-write scripts/process-sprite.ts \
  --input ./raw/knight.png \
  --output ./processed/knight.png \
  --remove-bg \
  --resize 64x64 \
  --filter nearest

Phase 4: Godot Integration

阶段4:Godot集成

Prepare assets for Godot import:
  1. Pack Sprite Sheets: Combine frames into optimized sheets
  2. Generate Import Files: Create
    .import
    with optimal settings
  3. Configure Animations: Set up SpriteFrames resources
为Godot导入准备资产:
  1. 打包精灵图集:将动画帧合并为优化后的图集
  2. 生成导入文件:创建配置最优的
    .import
    文件
  3. 配置动画:设置SpriteFrames资源

API Provider Selection

API服务商选择

ProviderBest ForQualityCostSpeed
DALL-E 3Consistency, high detailExcellent$$$Medium
ReplicateStyle control, variationsVery Good$$Medium
fal.aiFast iteration, testingGood$Fast
服务商适用场景质量成本速度
DALL-E 3风格一致性、高细节极佳$$$中等
Replicate风格控制、变体生成优秀$$中等
fal.ai快速迭代、测试良好$快速

DALL-E 3 (OpenAI)

DALL-E 3(OpenAI)

Best for high-quality, consistent results. Excellent prompt following.
bash
--provider dalle --model dall-e-3
  • Sizes: 1024x1024, 1792x1024, 1024x1792
  • Quality: standard, hd
  • Style: vivid, natural
最适合生成高质量、风格一致的结果,对提示词的遵循度极佳。
bash
--provider dalle --model dall-e-3
  • 尺寸:1024x1024、1792x1024、1024x1792
  • 质量:standard、hd
  • 风格:vivid、natural

Replicate (SDXL/Flux)

Replicate(SDXL/Flux)

Best for style control and cheaper batch generation.
bash
--provider replicate --model stability-ai/sdxl
  • More model options (SDXL, Flux, specialized)
  • Negative prompts supported
  • ControlNet and img2img available
最适合风格控制和低成本批量生成。
bash
--provider replicate --model stability-ai/sdxl
  • 更多模型选项(SDXL、Flux、专用模型)
  • 支持负向提示词
  • 提供ControlNet和img2img功能

fal.ai

fal.ai

Best for rapid iteration and testing prompts.
bash
--provider fal --model fal-ai/flux/schnell
  • Fastest inference
  • Good for prototyping
  • Lower cost per image
最适合快速迭代和测试提示词。
bash
--provider fal --model fal-ai/flux/schnell
  • 推理速度最快
  • 适合原型制作
  • 单张图像成本更低

Prompting by Art Style

按美术风格编写提示词

Pixel Art

像素画

"pixel art [subject], 16-bit style, clean pixels, no anti-aliasing,
limited color palette, retro game sprite, transparent background"
Key modifiers:
16-bit
,
8-bit
,
pixel art
,
retro
,
clean pixels
,
no anti-aliasing
Avoid:
realistic
,
detailed
,
smooth
,
gradient
"pixel art [subject], 16-bit style, clean pixels, no anti-aliasing,
limited color palette, retro game sprite, transparent background"
核心修饰词
16-bit
8-bit
pixel art
retro
clean pixels
no anti-aliasing
避免使用
realistic
detailed
smooth
gradient

Hand-Drawn / Illustrated

手绘/插画风格

"hand-drawn illustration of [subject], ink lines, watercolor texture,
sketch style, game art, white background"
Key modifiers:
hand-drawn
,
illustration
,
ink lines
,
sketch
,
watercolor
"hand-drawn illustration of [subject], ink lines, watercolor texture,
sketch style, game art, white background"
核心修饰词
hand-drawn
illustration
ink lines
sketch
watercolor

Painterly / Concept Art

油画风/概念艺术

"digital painting of [subject], concept art style, painterly brush strokes,
dramatic lighting, game asset"
Key modifiers:
digital painting
,
concept art
,
painterly
,
brush strokes
"digital painting of [subject], concept art style, painterly brush strokes,
dramatic lighting, game asset"
核心修饰词
digital painting
concept art
painterly
brush strokes

Vector / Flat Design

矢量/扁平化设计

"flat design [subject], vector art style, clean edges, solid colors,
minimal shading, game icon, transparent background"
Key modifiers:
flat design
,
vector
,
clean edges
,
solid colors
,
minimal
"flat design [subject], vector art style, clean edges, solid colors,
minimal shading, game icon, transparent background"
核心修饰词
flat design
vector
clean edges
solid colors
minimal

Script Reference

脚本参考

generate-image.ts

generate-image.ts

Generate a single image from any supported provider.
bash
deno run --allow-env --allow-net --allow-write scripts/generate-image.ts [options]

Options:
  --provider <name>   Provider: dalle, replicate, fal (required)
  --prompt <text>     Generation prompt (required)
  --output <path>     Output file path (required)
  --model <name>      Specific model (optional, provider-dependent)
  --size <WxH>        Image size, e.g., 1024x1024 (default: 1024x1024)
  --style <name>      Style preset: pixel-art, hand-drawn, painterly, vector
  --negative <text>   Negative prompt (Replicate/fal only)
  --quality <level>   Quality: standard, hd (DALL-E only)
  --json              Output metadata as JSON
  -h, --help          Show help
从任意支持的服务商生成单张图像。
bash
deno run --allow-env --allow-net --allow-write scripts/generate-image.ts [options]

Options:
  --provider <name>   服务商:dalle、replicate、fal(必填)
  --prompt <text>     生成提示词(必填)
  --output <path>     输出文件路径(必填)
  --model <name>      特定模型(可选,取决于服务商)
  --size <WxH>        图像尺寸,例如1024x1024(默认:1024x1024)
  --style <name>      风格预设:pixel-art、hand-drawn、painterly、vector
  --negative <text>   负向提示词(仅Replicate/fal支持)
  --quality <level>   质量:standard、hd(仅DALL-E支持)
  --json              以JSON格式输出元数据
  -h, --help          显示帮助信息

batch-generate.ts

batch-generate.ts

Generate multiple images from a specification file.
bash
deno run --allow-env --allow-net --allow-read --allow-write scripts/batch-generate.ts [options]

Options:
  --spec <path>       Path to batch specification JSON (required)
  --output <dir>      Output directory (required)
  --concurrency <n>   Parallel requests (default: 2)
  --delay <ms>        Delay between requests (default: 1000)
  --resume            Resume from last successful
  --json              Output results as JSON
  -h, --help          Show help
Batch Spec Format:
json
{
  "provider": "replicate",
  "model": "stability-ai/sdxl",
  "style": "pixel-art",
  "basePrompt": "16-bit pixel art, game sprite, transparent background",
  "assets": [
    { "name": "player-idle", "prompt": "knight standing idle, front view" },
    { "name": "player-walk-1", "prompt": "knight walking, frame 1 of 4" },
    { "name": "player-walk-2", "prompt": "knight walking, frame 2 of 4" }
  ]
}
从规格文件生成多张图像。
bash
deno run --allow-env --allow-net --allow-read --allow-write scripts/batch-generate.ts [options]

Options:
  --spec <path>       批量规格JSON文件路径(必填)
  --output <dir>      输出目录(必填)
  --concurrency <n>   并行请求数(默认:2)
  --delay <ms>        请求间隔时间(默认:1000)
  --resume            从上一次成功生成处恢复
  --json              以JSON格式输出结果
  -h, --help          显示帮助信息
批量规格格式:
json
{
  "provider": "replicate",
  "model": "stability-ai/sdxl",
  "style": "pixel-art",
  "basePrompt": "16-bit pixel art, game sprite, transparent background",
  "assets": [
    { "name": "player-idle", "prompt": "knight standing idle, front view" },
    { "name": "player-walk-1", "prompt": "knight walking, frame 1 of 4" },
    { "name": "player-walk-2", "prompt": "knight walking, frame 2 of 4" }
  ]
}

process-sprite.ts

process-sprite.ts

Post-process generated images for game use.
bash
deno run --allow-read --allow-write scripts/process-sprite.ts [options]

Options:
  --input <path>      Input image path (required)
  --output <path>     Output image path (required)
  --remove-bg         Remove background (make transparent)
  --resize <WxH>      Resize to dimensions
  --filter <type>     Resize filter: nearest, linear (default: nearest)
  --trim              Trim transparent whitespace
  --padding <n>       Add padding pixels
  --color-key <hex>   Color to make transparent (e.g., ff00ff)
  -h, --help          Show help
对生成的图像进行后期处理,以适配游戏使用。
bash
deno run --allow-read --allow-write scripts/process-sprite.ts [options]

Options:
  --input <path>      输入图像路径(必填)
  --output <path>     输出图像路径(必填)
  --remove-bg         移除背景(设为透明)
  --resize <WxH>      调整至指定尺寸
  --filter <type>     缩放滤镜:nearest、linear(默认:nearest)
  --trim              裁剪透明空白区域
  --padding <n>       添加边距像素
  --color-key <hex>   设为透明的颜色(例如ff00ff)
  -h, --help          显示帮助信息

pack-spritesheet.ts

pack-spritesheet.ts

Pack multiple sprites into a sprite sheet.
bash
deno run --allow-read --allow-write scripts/pack-spritesheet.ts [options]

Options:
  --input <pattern>   Input files (glob pattern, required)
  --output <path>     Output sprite sheet path (required)
  --columns <n>       Number of columns (default: auto)
  --padding <n>       Padding between sprites (default: 0)
  --power-of-two      Force power-of-two dimensions
  --metadata <path>   Output JSON metadata path
  -h, --help          Show help
Output Metadata:
json
{
  "image": "player-sheet.png",
  "size": { "width": 256, "height": 128 },
  "frames": [
    { "name": "idle", "x": 0, "y": 0, "width": 64, "height": 64 },
    { "name": "walk-1", "x": 64, "y": 0, "width": 64, "height": 64 }
  ]
}
将多个精灵图打包成精灵图集。
bash
deno run --allow-read --allow-write scripts/pack-spritesheet.ts [options]

Options:
  --input <pattern>   输入文件(通配符模式,必填)
  --output <path>     精灵图集输出路径(必填)
  --columns <n>       列数(默认:自动)
  --padding <n>       精灵图之间的边距(默认:0)
  --power-of-two      强制使用2的幂次尺寸
  --metadata <path>   输出JSON元数据路径
  -h, --help          显示帮助信息
输出元数据:
json
{
  "image": "player-sheet.png",
  "size": { "width": 256, "height": 128 },
  "frames": [
    { "name": "idle", "x": 0, "y": 0, "width": 64, "height": 64 },
    { "name": "walk-1", "x": 64, "y": 0, "width": 64, "height": 64 }
  ]
}

generate-import-files.ts

generate-import-files.ts

Generate Godot .import files with optimal settings.
bash
deno run --allow-read --allow-write scripts/generate-import-files.ts [options]

Options:
  --input <path>      Input image or directory (required)
  --preset <name>     Preset: pixel-art, hd-sprite, ui (default: pixel-art)
  --frames <n>        Animation frame count (for sprite sheets)
  --columns <n>       Sprite sheet columns
  --fps <n>           Animation FPS (default: 12)
  -h, --help          Show help
生成配置最优的Godot .import文件。
bash
deno run --allow-read --allow-write scripts/generate-import-files.ts [options]

Options:
  --input <path>      输入图像或目录(必填)
  --preset <name>     预设:pixel-art、hd-sprite、ui(默认:pixel-art)
  --frames <n>        动画帧数量(针对精灵图集)
  --columns <n>       精灵图格列数
  --fps <n>           动画帧率(默认:12)
  -h, --help          显示帮助信息

Godot Import Settings

Godot 导入设置

Pixel Art Sprites

像素画精灵图

Filter Mode: Nearest
Compression: Lossless
Mipmaps: Off
Fix Alpha Border: On
Filter Mode: Nearest
Compression: Lossless
Mipmaps: Off
Fix Alpha Border: On

HD Sprites

HD精灵图

Filter Mode: Linear
Compression: VRAM Compressed
Mipmaps: On
Filter Mode: Linear
Compression: VRAM Compressed
Mipmaps: On

UI Elements

UI元素

Filter Mode: Linear (or Nearest for pixel UI)
Compression: Lossless
Mipmaps: Off
Filter Mode: Linear(像素风格UI使用Nearest)
Compression: Lossless
Mipmaps: Off

Examples

示例

Example 1: Pixel Art Character with Walk Animation

示例1:带行走动画的像素画角色

bash
undefined
bash
undefined

1. Create batch spec

1. 创建批量规格文件

cat > character-batch.json << 'EOF' { "provider": "replicate", "style": "pixel-art", "basePrompt": "16-bit pixel art knight, game sprite, transparent background", "assets": [ { "name": "knight-idle", "prompt": "standing idle, front view" }, { "name": "knight-walk-1", "prompt": "walking, left foot forward" }, { "name": "knight-walk-2", "prompt": "walking, standing straight" }, { "name": "knight-walk-3", "prompt": "walking, right foot forward" }, { "name": "knight-walk-4", "prompt": "walking, standing straight" } ] } EOF
cat > character-batch.json << 'EOF' { "provider": "replicate", "style": "pixel-art", "basePrompt": "16-bit pixel art knight, game sprite, transparent background", "assets": [ { "name": "knight-idle", "prompt": "standing idle, front view" }, { "name": "knight-walk-1", "prompt": "walking, left foot forward" }, { "name": "knight-walk-2", "prompt": "walking, standing straight" }, { "name": "knight-walk-3", "prompt": "walking, right foot forward" }, { "name": "knight-walk-4", "prompt": "walking, standing straight" } ] } EOF

2. Generate images

2. 生成图像

deno run --allow-env --allow-net --allow-read --allow-write
scripts/batch-generate.ts --spec character-batch.json --output ./raw/
deno run --allow-env --allow-net --allow-read --allow-write
scripts/batch-generate.ts --spec character-batch.json --output ./raw/

3. Process sprites

3. 处理精灵图

for f in ./raw/knight-*.png; do deno run --allow-read --allow-write scripts/process-sprite.ts
--input "$f" --output "./processed/$(basename $f)"
--remove-bg --resize 64x64 --filter nearest done
for f in ./raw/knight-*.png; do deno run --allow-read --allow-write scripts/process-sprite.ts
--input "$f" --output "./processed/$(basename $f)"
--remove-bg --resize 64x64 --filter nearest done

4. Pack sprite sheet

4. 打包精灵图集

deno run --allow-read --allow-write scripts/pack-spritesheet.ts
--input "./processed/knight-*.png"
--output ./sprites/knight-sheet.png
--columns 5 --metadata ./sprites/knight-sheet.json
deno run --allow-read --allow-write scripts/pack-spritesheet.ts
--input "./processed/knight-*.png"
--output ./sprites/knight-sheet.png
--columns 5 --metadata ./sprites/knight-sheet.json

5. Generate Godot import

5. 生成Godot导入文件

deno run --allow-read --allow-write scripts/generate-import-files.ts
--input ./sprites/knight-sheet.png --preset pixel-art
--frames 5 --columns 5 --fps 8
undefined
deno run --allow-read --allow-write scripts/generate-import-files.ts
--input ./sprites/knight-sheet.png --preset pixel-art
--frames 5 --columns 5 --fps 8
undefined

Example 2: Tileset Generation

示例2:Tileset生成

bash
undefined
bash
undefined

Generate individual tiles

生成单个 tiles

deno run --allow-env --allow-net --allow-write scripts/generate-image.ts
--provider dalle
--prompt "seamless pixel art grass tile, top-down view, 32x32, game tileset"
--output ./tiles/grass.png
--style pixel-art
deno run --allow-env --allow-net --allow-write scripts/generate-image.ts
--provider dalle
--prompt "seamless pixel art grass tile, top-down view, 32x32, game tileset"
--output ./tiles/grass.png
--style pixel-art

Process and resize

处理并调整尺寸

deno run --allow-read --allow-write scripts/process-sprite.ts
--input ./tiles/grass.png --output ./tiles/grass-processed.png
--resize 32x32 --filter nearest
undefined
deno run --allow-read --allow-write scripts/process-sprite.ts
--input ./tiles/grass.png --output ./tiles/grass-processed.png
--resize 32x32 --filter nearest
undefined

Example 3: UI Icons

示例3:UI图标

bash
undefined
bash
undefined

Batch generate UI icons

批量生成UI图标

cat > ui-batch.json << 'EOF' { "provider": "fal", "style": "vector", "basePrompt": "flat design game icon, clean edges, solid colors, transparent background", "assets": [ { "name": "icon-sword", "prompt": "sword weapon icon" }, { "name": "icon-shield", "prompt": "shield defense icon" }, { "name": "icon-potion", "prompt": "health potion bottle icon" }, { "name": "icon-coin", "prompt": "gold coin currency icon" } ] } EOF
deno run --allow-env --allow-net --allow-read --allow-write
scripts/batch-generate.ts --spec ui-batch.json --output ./icons/
undefined
cat > ui-batch.json << 'EOF' { "provider": "fal", "style": "vector", "basePrompt": "flat design game icon, clean edges, solid colors, transparent background", "assets": [ { "name": "icon-sword", "prompt": "sword weapon icon" }, { "name": "icon-shield", "prompt": "shield defense icon" }, { "name": "icon-potion", "prompt": "health potion bottle icon" }, { "name": "icon-coin", "prompt": "gold coin currency icon" } ] } EOF
deno run --allow-env --allow-net --allow-read --allow-write
scripts/batch-generate.ts --spec ui-batch.json --output ./icons/
undefined

Common Issues

常见问题

API Key Not Found

API密钥未找到

Error: OPENAI_API_KEY environment variable is not set
Solution: Export the API key before running:
bash
export OPENAI_API_KEY="sk-..."
Error: OPENAI_API_KEY environment variable is not set
解决方案:运行前导出API密钥:
bash
export OPENAI_API_KEY="sk-..."

Inconsistent Style Across Batch

批量生成的风格不一致

Problem: Generated images have different styles despite same prompt.
Solutions:
  • Use more specific style modifiers
  • Use Replicate with seed parameter for reproducibility
  • Generate more images and select best matches
  • Use img2img with reference image (Replicate)
问题:尽管使用相同提示词,生成的图像风格仍存在差异。
解决方案
  • 使用更具体的风格修饰词
  • 使用Replicate并设置seed参数以保证可重复性
  • 生成更多图像并选择最佳匹配
  • 使用Replicate的img2img功能,结合参考图像

Background Removal Fails

背景移除失败

Problem:
--remove-bg
doesn't cleanly separate sprite.
Solutions:
  • Add "transparent background" or "white background" to prompt
  • Use
    --color-key
    with a specific background color
  • Use more explicit prompts: "isolated on transparent background"
  • Manual cleanup may be needed for complex images
问题
--remove-bg
无法干净地分离精灵图。
解决方案
  • 在提示词中添加“transparent background”或“white background”
  • 使用
    --color-key
    指定特定背景色
  • 使用更明确的提示词:“isolated on transparent background”
  • 复杂图像可能需要手动清理

Pixel Art Has Anti-Aliasing

像素画出现抗锯齿效果

Problem: Generated pixel art has smoothed edges.
Solutions:
  • Add "no anti-aliasing", "clean pixels" to prompt
  • Generate at larger size, then downscale with nearest neighbor
  • Use
    --filter nearest
    in process-sprite.ts
  • Post-process with palette reduction
问题:生成的像素画边缘有平滑效果。
解决方案
  • 在提示词中添加“no anti-aliasing”、“clean pixels”
  • 先生成大尺寸图像,再使用最近邻算法缩小
  • 在process-sprite.ts中使用
    --filter nearest
  • 后期处理时减少调色板颜色数量

Rate Limiting

速率限制

Problem: API returns 429 rate limit errors.
Solutions:
  • Increase
    --delay
    in batch-generate.ts
  • Reduce
    --concurrency
  • Wait and retry
  • Use different provider for large batches
问题:API返回429速率限制错误。
解决方案
  • 增加batch-generate.ts中的
    --delay
    参数
  • 减少
    --concurrency
    参数
  • 等待后重试
  • 大批量生成时更换服务商

Additional Resources

额外资源

Prompting Guides

提示词指南

  • references/prompting/pixel-art.md
    - Detailed pixel art techniques
  • references/prompting/hand-drawn.md
    - Illustrated style guide
  • references/prompting/consistent-characters.md
    - Character consistency
  • references/prompting/pixel-art.md
    - 详细的像素画技巧
  • references/prompting/hand-drawn.md
    - 插画风格指南
  • references/prompting/consistent-characters.md
    - 角色风格一致性指南

API Guides

API指南

  • references/api-guides/openai-dalle.md
    - DALL-E 3 API reference
  • references/api-guides/replicate-sdxl.md
    - Replicate integration
  • references/api-guides/fal-ai.md
    - fal.ai guide
  • references/api-guides/openai-dalle.md
    - DALL-E 3 API参考
  • references/api-guides/replicate-sdxl.md
    - Replicate集成指南
  • references/api-guides/fal-ai.md
    - fal.ai使用指南

Godot Integration

Godot集成

  • references/godot-integration/import-settings.md
    - Import configuration
  • references/godot-integration/animation-setup.md
    - AnimatedSprite2D setup
  • references/godot-integration/import-settings.md
    - 导入配置指南
  • references/godot-integration/animation-setup.md
    - AnimatedSprite2D设置指南

Templates

模板

  • assets/prompts/pixel-art-templates.json
    - Pixel art prompt templates
  • assets/prompts/character-templates.json
    - Character prompts
  • assets/style-guides/style-guide-template.json
    - Style guide schema
  • assets/prompts/pixel-art-templates.json
    - 像素画提示词模板
  • assets/prompts/character-templates.json
    - 角色提示词模板
  • assets/style-guides/style-guide-template.json
    - 风格指南模板

Limitations

局限性

  • API-based only: Requires internet and API keys (no local models)
  • Style consistency: AI may produce variations despite same prompt
  • Resolution constraints: Each provider has size limits
  • 2D assets only: Not for 3D models, textures, or complex animations
  • Background removal: May require manual cleanup for complex images
  • Cost: API calls incur charges, especially for large batches
  • 仅支持API调用:需要联网和API密钥(不支持本地模型)
  • 风格一致性:即使使用相同提示词,AI仍可能生成变体
  • 分辨率限制:每个服务商都有尺寸限制
  • 仅支持2D资产:不支持3D模型、纹理或复杂动画
  • 背景移除:复杂图像可能需要手动清理
  • 成本:API调用会产生费用,尤其是大批量生成时