mcp-tool-shop-org/sprite-foundry

Headless sprite generation pipeline — ComfyUI + SQLite + Godot finish lab

Python

2

50 commits

updated Oct 1, 2026

See the code

README

日本語 | 中文 | Español | Français | हिन्दी | Italiano | Português (BR)

Sprite Foundry

Headless, canon-bound sprite pipeline — 8-direction pixel-art packs for 2.5D RPGs

CI License Handbook


Sprite Foundry is a local-only asset pipeline that generates, reviews, and exports 8-direction pixel sprites with normal and depth maps. It drives ComfyUI for generation with ControlNet morphology control (8 body classes), SQLite for lifecycle tracking, and Godot 4.6 for finish-lab lighting verification — all controlled from a single CLI.

The sprite packs this factory produces are published to npm under the @sprite-foundry scope, from the sprite-foundry-packs monorepo. This repo is the factory; that repo is the storefront.

Architecture

Subject Sheet ──► ComfyUI Generation ──► Mechanical Gates
                  (SDXL + LoRA +          (transparency,
                   ControlNet)             dimensions, count)
                                                │
                                                ▼
                                        Raw/Pixel Review
                                                │
                                                ▼
                                    Normal + Depth Map Gen
                                                │
                                                ▼
                                     Godot Finish Lab
                                     (4 lighting states)
                                                │
                                                ▼
                                      Deterministic Export
                                      (manifest + checksums)

Roster

92 production export packs across 12 lanes:

LaneCountSubjects
Beast16Bell Warden, Bone Weaver, Clock Golem, Grinning Idol, Hive Keeper, Hollow Knight, Ink Shade, Lantern Angler, Mirror Stalker, Mud Revenant, Rat King, Root Puppet, Spore Mother, Teeth Collector, Throat Singer, Wyvern
Townsfolk16Barmaid, Beggar, Blacksmith, Child, Elder, Farmer, Fisherman, Guard, Herbalist, Innkeeper, Lamplighter, Merchant, Minstrel, Noble, Scribe, Stable Hand
Goblin8Archer, Bomber, Brute, Grunt, Scout, Shaman, Warchief, Wolf Rider
Hero8Barbarian, Cleric, Fighter, Mage, Monk, Paladin, Ranger, Rogue
Pirate8Captain, Cutthroat, Drowned, Governor, Navy Sailor, Pistoleer, Quartermaster, Sea Priest
Villain8Assassin, Blackguard, Cult Priest, Dark Monk, Dread Ranger, Necromancer, Reaver, Warlord
Zombie8Bloater, Elite, Hazmat, Riot, Runner, Shambler, Skeletal, Worker
Creature6Cargo Beast, Drift Maw, Skitter Drone, Drift Lurker, Void Raptor, Keth Healer-Drone
Crew7Sera Vale, Ilen Marr, Thal, Thal (Hazard Suit), Varek, Kael Morrow, Hull Diver
Hostile3Scav Raider, Reach Pirate, Compact Interdiction Agent
Authority2Compact Patrol Officer, Veshan House Envoy
Civilian2Nera Quill, Orryn Broker

Monster Lane

Non-humanoid creatures use body-class-specific ControlNet depth guides instead of the standard humanoid skeleton. Each body class has its own depth reference silhouette, ControlNet strength, and timing parameters.

Body ClassDepth StrengthEnd %Creatures
Amorphous0.3565%Rat King, Spore Mother, Mud Revenant
Wide/Squat0.4070%Grinning Idol
Tall/Thin0.4070%Lantern Angler, Root Puppet

Depth guides are joint-free primitives (blobs, pillars, columns) that lock in mass and orientation without dictating skeleton or limb placement. The body_class field in character configs auto-selects the correct preset:

# Body class auto-resolved from config
python -m pipeline.foundry_gen_morph --config pipeline/chars/beast_rat_king.json

# CLI override
python -m pipeline.foundry_gen_morph --config pipeline/chars/beast_rat_king.json --body-class tall_thin

Export Contract v1.0.0 (frozen)

exports/{subject_slug}/{run_id}/
├── albedo/    8 × 48px transparent PNGs
├── normal/    8 × matching normal maps
├── depth/     8 × matching depth maps
├── preview/   contact sheet
└── manifest.json  (schema v1.0.0, SHA-256 checksums, provenance)
  • 8 directions: front, front_left, left, back_left, back, back_right, right, front_right
  • 48×48 transparent PNG, center_bottom pivot
  • Consumers validate schema_version: "1.0.0" before loading

Prerequisites

  • Python 3.11+
  • ComfyUI running locally (for generation)
  • Godot 4.6 (for finish lab rendering)
  • NVIDIA GPU recommended (RTX 5090 / 32 GB tested; 16 GB minimum)

Quick Start

# Clone
git clone https://github.com/mcp-tool-shop-org/sprite-foundry.git
cd sprite-foundry

# Initialize the registry
python -m foundry init

# Register a subject
python -m foundry subject-add sera_vale "Sera Vale" --role crew --consumer my-game

# Check the full pipeline status
python -m foundry status

CLI Commands

CommandDescription
initInitialize the foundry SQLite registry
subject-addRegister a new character subject
register-runRecord a ComfyUI generation run
register-attemptRecord an individual attempt within a run
checkRun mechanical validation gates
review-showDisplay review queue for a run
review-acceptAccept an attempt at current review stage
review-rejectReject an attempt with a reject code
batch-acceptAccept all pending attempts in a run
batch-rejectReject all pending in a run with one code
regenQueue regeneration for rejected attempts
attempt-detailShow full lifecycle for one attempt
finish-boardGenerate a finish-lab comparison board
statusPipeline status summary
storyFull provenance narrative for a subject
lineageRegen chain for an attempt
winnerCanonical winner per direction
driftFailure pattern analysis and pass rates
metricsThroughput metrics (per-run or foundry-wide)
produceOne-command: maps + finish captures for an accepted run
exportExport a finish-accepted run as a deterministic asset pack

Threat Model

Sprite Foundry is a local developer tool. It does not handle secrets, tokens, or credentials, and collects no telemetry. Network/filesystem footprint differs by subsystem:

foundry/ (the lifecycle-tracking CLI): does not access the network (ComfyUI runs on localhost). File operations are constrained to exports/, bakeoff/, boards/, derived/, and the SQLite registry. Subprocess calls are limited to ComfyUI's local API and Godot headless rendering.

3d-prerender/ (the mesh/retexture/render pipeline): does access the network — its jury scripts (pack_jury.py, sprite_jury.py, invocable via cli.py jury) send rendered character images to cloud-hosted vision models over Ollama's cloud API for QA scoring. Do not point the jury at images containing sensitive or unreleased material without accounting for that. File operations are NOT constrained to a subdirectory of this repo — 3d-prerender/config.py's defaults read/write rig model caches and working directories outside the repo (e.g. E:/AI-Models, a configurable working-copy path) by design, since this is a local generation pipeline, not a sandboxed tool; every path is overridable via an SF_* environment variable (see 3d-prerender/config.py).

License

MIT


Built by MCP Tool Shop

8-direction
asset-pipeline
comfyui
controlnet
game-assets
godot
morphology
normal-maps
pixel-art
sprite

mcp-tool-shop-org/sprite-foundry

Headless sprite generation pipeline — ComfyUI + SQLite + Godot finish lab

Python

2

50 commits

updated Oct 1, 2026

See the code

README

日本語 | 中文 | Español | Français | हिन्दी | Italiano | Português (BR)

Sprite Foundry

Headless, canon-bound sprite pipeline — 8-direction pixel-art packs for 2.5D RPGs

CI License Handbook


Sprite Foundry is a local-only asset pipeline that generates, reviews, and exports 8-direction pixel sprites with normal and depth maps. It drives ComfyUI for generation with ControlNet morphology control (8 body classes), SQLite for lifecycle tracking, and Godot 4.6 for finish-lab lighting verification — all controlled from a single CLI.

The sprite packs this factory produces are published to npm under the @sprite-foundry scope, from the sprite-foundry-packs monorepo. This repo is the factory; that repo is the storefront.

Architecture

Subject Sheet ──► ComfyUI Generation ──► Mechanical Gates
                  (SDXL + LoRA +          (transparency,
                   ControlNet)             dimensions, count)
                                                │
                                                ▼
                                        Raw/Pixel Review
                                                │
                                                ▼
                                    Normal + Depth Map Gen
                                                │
                                                ▼
                                     Godot Finish Lab
                                     (4 lighting states)
                                                │
                                                ▼
                                      Deterministic Export
                                      (manifest + checksums)

Roster

92 production export packs across 12 lanes:

LaneCountSubjects
Beast16Bell Warden, Bone Weaver, Clock Golem, Grinning Idol, Hive Keeper, Hollow Knight, Ink Shade, Lantern Angler, Mirror Stalker, Mud Revenant, Rat King, Root Puppet, Spore Mother, Teeth Collector, Throat Singer, Wyvern
Townsfolk16Barmaid, Beggar, Blacksmith, Child, Elder, Farmer, Fisherman, Guard, Herbalist, Innkeeper, Lamplighter, Merchant, Minstrel, Noble, Scribe, Stable Hand
Goblin8Archer, Bomber, Brute, Grunt, Scout, Shaman, Warchief, Wolf Rider
Hero8Barbarian, Cleric, Fighter, Mage, Monk, Paladin, Ranger, Rogue
Pirate8Captain, Cutthroat, Drowned, Governor, Navy Sailor, Pistoleer, Quartermaster, Sea Priest
Villain8Assassin, Blackguard, Cult Priest, Dark Monk, Dread Ranger, Necromancer, Reaver, Warlord
Zombie8Bloater, Elite, Hazmat, Riot, Runner, Shambler, Skeletal, Worker
Creature6Cargo Beast, Drift Maw, Skitter Drone, Drift Lurker, Void Raptor, Keth Healer-Drone
Crew7Sera Vale, Ilen Marr, Thal, Thal (Hazard Suit), Varek, Kael Morrow, Hull Diver
Hostile3Scav Raider, Reach Pirate, Compact Interdiction Agent
Authority2Compact Patrol Officer, Veshan House Envoy
Civilian2Nera Quill, Orryn Broker

Monster Lane

Non-humanoid creatures use body-class-specific ControlNet depth guides instead of the standard humanoid skeleton. Each body class has its own depth reference silhouette, ControlNet strength, and timing parameters.

Body ClassDepth StrengthEnd %Creatures
Amorphous0.3565%Rat King, Spore Mother, Mud Revenant
Wide/Squat0.4070%Grinning Idol
Tall/Thin0.4070%Lantern Angler, Root Puppet

Depth guides are joint-free primitives (blobs, pillars, columns) that lock in mass and orientation without dictating skeleton or limb placement. The body_class field in character configs auto-selects the correct preset:

# Body class auto-resolved from config
python -m pipeline.foundry_gen_morph --config pipeline/chars/beast_rat_king.json

# CLI override
python -m pipeline.foundry_gen_morph --config pipeline/chars/beast_rat_king.json --body-class tall_thin

Export Contract v1.0.0 (frozen)

exports/{subject_slug}/{run_id}/
├── albedo/    8 × 48px transparent PNGs
├── normal/    8 × matching normal maps
├── depth/     8 × matching depth maps
├── preview/   contact sheet
└── manifest.json  (schema v1.0.0, SHA-256 checksums, provenance)
  • 8 directions: front, front_left, left, back_left, back, back_right, right, front_right
  • 48×48 transparent PNG, center_bottom pivot
  • Consumers validate schema_version: "1.0.0" before loading

Prerequisites

  • Python 3.11+
  • ComfyUI running locally (for generation)
  • Godot 4.6 (for finish lab rendering)
  • NVIDIA GPU recommended (RTX 5090 / 32 GB tested; 16 GB minimum)

Quick Start

# Clone
git clone https://github.com/mcp-tool-shop-org/sprite-foundry.git
cd sprite-foundry

# Initialize the registry
python -m foundry init

# Register a subject
python -m foundry subject-add sera_vale "Sera Vale" --role crew --consumer my-game

# Check the full pipeline status
python -m foundry status

CLI Commands

CommandDescription
initInitialize the foundry SQLite registry
subject-addRegister a new character subject
register-runRecord a ComfyUI generation run
register-attemptRecord an individual attempt within a run
checkRun mechanical validation gates
review-showDisplay review queue for a run
review-acceptAccept an attempt at current review stage
review-rejectReject an attempt with a reject code
batch-acceptAccept all pending attempts in a run
batch-rejectReject all pending in a run with one code
regenQueue regeneration for rejected attempts
attempt-detailShow full lifecycle for one attempt
finish-boardGenerate a finish-lab comparison board
statusPipeline status summary
storyFull provenance narrative for a subject
lineageRegen chain for an attempt
winnerCanonical winner per direction
driftFailure pattern analysis and pass rates
metricsThroughput metrics (per-run or foundry-wide)
produceOne-command: maps + finish captures for an accepted run
exportExport a finish-accepted run as a deterministic asset pack

Threat Model

Sprite Foundry is a local developer tool. It does not handle secrets, tokens, or credentials, and collects no telemetry. Network/filesystem footprint differs by subsystem:

foundry/ (the lifecycle-tracking CLI): does not access the network (ComfyUI runs on localhost). File operations are constrained to exports/, bakeoff/, boards/, derived/, and the SQLite registry. Subprocess calls are limited to ComfyUI's local API and Godot headless rendering.

3d-prerender/ (the mesh/retexture/render pipeline): does access the network — its jury scripts (pack_jury.py, sprite_jury.py, invocable via cli.py jury) send rendered character images to cloud-hosted vision models over Ollama's cloud API for QA scoring. Do not point the jury at images containing sensitive or unreleased material without accounting for that. File operations are NOT constrained to a subdirectory of this repo — 3d-prerender/config.py's defaults read/write rig model caches and working directories outside the repo (e.g. E:/AI-Models, a configurable working-copy path) by design, since this is a local generation pipeline, not a sandboxed tool; every path is overridable via an SF_* environment variable (see 3d-prerender/config.py).

License

MIT


Built by MCP Tool Shop

8-direction
asset-pipeline
comfyui
controlnet
game-assets
godot
morphology
normal-maps
pixel-art
sprite