godot-asset-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGodot 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:
- for DALL-E 3
OPENAI_API_KEY - for Replicate (SDXL, Flux)
REPLICATE_API_TOKEN - for fal.ai
FAL_KEY
Optional:
- ImageMagick for advanced image processing
- Godot 4.x project for import file generation
必需项:
- 已安装Deno运行时
- 至少拥有一个API密钥:
- (用于DALL-E 3)
OPENAI_API_KEY - (用于Replicate,支持SDXL、Flux)
REPLICATE_API_TOKEN - (用于fal.ai)
FAL_KEY
可选项:
- 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.pngbash
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.pngBatch 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 4bash
deno run --allow-read --allow-write scripts/pack-spritesheet.ts \
--input ./generated/*.png \
--output ./sprites/player-sheet.png \
--columns 4Core Workflow
核心工作流
Phase 1: Style Definition
阶段1:风格定义
Define your art style before generating assets:
- Choose Art Style: Pixel art, hand-drawn, painterly, or vector
- Create Style Guide: Document colors, modifiers, and constraints
- 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"
}在生成资产前定义你的美术风格:
- 选择美术风格:像素画、手绘、油画风或矢量图
- 创建风格指南:记录色彩、修饰词和约束条件
- 测试提示词:生成样例以验证风格一致性
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:
- Single Assets: Use for individual images
generate-image.ts - Batch Assets: Use for multiple related assets
batch-generate.ts - Iterate: Refine prompts based on results
使用合适的服务商生成资产:
- 单个资产:使用生成单张图像
generate-image.ts - 批量资产:使用生成多个相关资产
batch-generate.ts - 迭代优化:根据结果调整提示词
Phase 3: Post-Processing
阶段3:后期处理
Prepare raw AI output for game use:
- Background Removal: Extract sprites from backgrounds
- Color Correction: Normalize palette if needed
- Resize: Scale to exact game resolution
- 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生成的原始输出调整为适合游戏使用的格式:
- 移除背景:将精灵图从背景中提取出来
- 色彩校正:如有需要,统一调色板
- 调整尺寸:缩放至游戏所需的精确分辨率
- 裁剪/补边:移除空白区域,为精灵图添加边距
bash
deno run --allow-read --allow-write scripts/process-sprite.ts \
--input ./raw/knight.png \
--output ./processed/knight.png \
--remove-bg \
--resize 64x64 \
--filter nearestPhase 4: Godot Integration
阶段4:Godot集成
Prepare assets for Godot import:
- Pack Sprite Sheets: Combine frames into optimized sheets
- Generate Import Files: Create with optimal settings
.import - Configure Animations: Set up SpriteFrames resources
为Godot导入准备资产:
- 打包精灵图集:将动画帧合并为优化后的图集
- 生成导入文件:创建配置最优的文件
.import - 配置动画:设置SpriteFrames资源
API Provider Selection
API服务商选择
| Provider | Best For | Quality | Cost | Speed |
|---|---|---|---|---|
| DALL-E 3 | Consistency, high detail | Excellent | $$$ | Medium |
| Replicate | Style control, variations | Very Good | $$ | Medium |
| fal.ai | Fast iteration, testing | Good | $ | 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-bit8-bitpixel artretroclean pixelsno anti-aliasingAvoid: , , ,
realisticdetailedsmoothgradient"pixel art [subject], 16-bit style, clean pixels, no anti-aliasing,
limited color palette, retro game sprite, transparent background"核心修饰词:、、、、、
16-bit8-bitpixel artretroclean pixelsno anti-aliasing避免使用:、、、
realisticdetailedsmoothgradientHand-Drawn / Illustrated
手绘/插画风格
"hand-drawn illustration of [subject], ink lines, watercolor texture,
sketch style, game art, white background"Key modifiers: , , , ,
hand-drawnillustrationink linessketchwatercolor"hand-drawn illustration of [subject], ink lines, watercolor texture,
sketch style, game art, white background"核心修饰词:、、、、
hand-drawnillustrationink linessketchwatercolorPainterly / Concept Art
油画风/概念艺术
"digital painting of [subject], concept art style, painterly brush strokes,
dramatic lighting, game asset"Key modifiers: , , ,
digital paintingconcept artpainterlybrush strokes"digital painting of [subject], concept art style, painterly brush strokes,
dramatic lighting, game asset"核心修饰词:、、、
digital paintingconcept artpainterlybrush strokesVector / Flat Design
矢量/扁平化设计
"flat design [subject], vector art style, clean edges, solid colors,
minimal shading, game icon, transparent background"Key modifiers: , , , ,
flat designvectorclean edgessolid colorsminimal"flat design [subject], vector art style, clean edges, solid colors,
minimal shading, game icon, transparent background"核心修饰词:、、、、
flat designvectorclean edgessolid colorsminimalScript 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 helpBatch 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 helpOutput 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: OnFilter Mode: Nearest
Compression: Lossless
Mipmaps: Off
Fix Alpha Border: OnHD Sprites
HD精灵图
Filter Mode: Linear
Compression: VRAM Compressed
Mipmaps: OnFilter Mode: Linear
Compression: VRAM Compressed
Mipmaps: OnUI Elements
UI元素
Filter Mode: Linear (or Nearest for pixel UI)
Compression: Lossless
Mipmaps: OffFilter Mode: Linear(像素风格UI使用Nearest)
Compression: Lossless
Mipmaps: OffExamples
示例
Example 1: Pixel Art Character with Walk Animation
示例1:带行走动画的像素画角色
bash
undefinedbash
undefined1. 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/
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/
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
--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
--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
--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
--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
--input ./sprites/knight-sheet.png --preset pixel-art
--frames 5 --columns 5 --fps 8
undefineddeno run --allow-read --allow-write scripts/generate-import-files.ts
--input ./sprites/knight-sheet.png --preset pixel-art
--frames 5 --columns 5 --fps 8
--input ./sprites/knight-sheet.png --preset pixel-art
--frames 5 --columns 5 --fps 8
undefinedExample 2: Tileset Generation
示例2:Tileset生成
bash
undefinedbash
undefinedGenerate 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
--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
--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
--input ./tiles/grass.png --output ./tiles/grass-processed.png
--resize 32x32 --filter nearest
undefineddeno run --allow-read --allow-write scripts/process-sprite.ts
--input ./tiles/grass.png --output ./tiles/grass-processed.png
--resize 32x32 --filter nearest
--input ./tiles/grass.png --output ./tiles/grass-processed.png
--resize 32x32 --filter nearest
undefinedExample 3: UI Icons
示例3:UI图标
bash
undefinedbash
undefinedBatch 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/
scripts/batch-generate.ts --spec ui-batch.json --output ./icons/
undefinedcat > 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/
scripts/batch-generate.ts --spec ui-batch.json --output ./icons/
undefinedCommon Issues
常见问题
API Key Not Found
API密钥未找到
Error: OPENAI_API_KEY environment variable is not setSolution: 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: doesn't cleanly separate sprite.
--remove-bgSolutions:
- Add "transparent background" or "white background" to prompt
- Use with a specific background color
--color-key - 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 in process-sprite.ts
--filter nearest - 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 in batch-generate.ts
--delay - Reduce
--concurrency - Wait and retry
- Use different provider for large batches
问题:API返回429速率限制错误。
解决方案:
- 增加batch-generate.ts中的参数
--delay - 减少参数
--concurrency - 等待后重试
- 大批量生成时更换服务商
Additional Resources
额外资源
Prompting Guides
提示词指南
- - Detailed pixel art techniques
references/prompting/pixel-art.md - - Illustrated style guide
references/prompting/hand-drawn.md - - Character consistency
references/prompting/consistent-characters.md
- - 详细的像素画技巧
references/prompting/pixel-art.md - - 插画风格指南
references/prompting/hand-drawn.md - - 角色风格一致性指南
references/prompting/consistent-characters.md
API Guides
API指南
- - DALL-E 3 API reference
references/api-guides/openai-dalle.md - - Replicate integration
references/api-guides/replicate-sdxl.md - - fal.ai guide
references/api-guides/fal-ai.md
- - DALL-E 3 API参考
references/api-guides/openai-dalle.md - - Replicate集成指南
references/api-guides/replicate-sdxl.md - - fal.ai使用指南
references/api-guides/fal-ai.md
Godot Integration
Godot集成
- - Import configuration
references/godot-integration/import-settings.md - - AnimatedSprite2D setup
references/godot-integration/animation-setup.md
- - 导入配置指南
references/godot-integration/import-settings.md - - AnimatedSprite2D设置指南
references/godot-integration/animation-setup.md
Templates
模板
- - Pixel art prompt templates
assets/prompts/pixel-art-templates.json - - Character prompts
assets/prompts/character-templates.json - - Style guide schema
assets/style-guides/style-guide-template.json
- - 像素画提示词模板
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调用会产生费用,尤其是大批量生成时