Sprites
Draw a pose draft, let the local AI paint it, and keep the best candidate. Characters, top-down heroes, portraits, isometric buildings, scenes and icons.
A Mode 8 sprite starts as a draft: a small shaded blockout that fixes the pose, the facing and the size. A local model then repaints the draft as finished pixel art, and Mode 8 snaps the result to a real pixel grid and a palette, checks it, and keeps the best of several candidates. The draft runs on any computer; the repaint needs ComfyUI and a GPU.

The whole path is two commands:
$ mode8 draft knight_right --out drafts/hero.png
✓ Drafted knight_right (64x72) → drafts/hero.png
Next:
mode8 gen 'armored knight with plumed helm, side view, facing right' --draft drafts/hero.png --out sprites/hero.png # needs ComfyUI
mode8 anim drafts/hero.png --rig humanoid --out-dir frames/hero
mode8 studio .$ mode8 gen "armored knight with a crimson cloak and a red plume" --draft drafts/hero.png --palette nes_master_gothic --seed 8101 --out sprites/hero.png
✓ Generated sprites/hero.png (64x72)
best of 3 candidates (#1), 3 passed · score 14.478 · 12 colors
preset kleinedit · 2 passes
art 64x72 px on a 12 px grid, kept 1:1
palette fit 0.040 (fair) · pose match 0.89 · fidelity 0.76 · no outline added
Next:
mode8 anim sprites/hero.png --rig humanoid --out-dir frames/hero
mode8 lint sprites/hero.png --qualityThe rest of this page is about choosing the draft, steering the generation, and fixing what comes out.
Drafts#
A model asked for "a knight" from text alone picks a different facing, scale and silhouette every time. A draft decides those before any AI runs, so a whole cast comes out the same size, lit from the same side, facing the way your game needs.
Mode 8 draws drafts for 20 archetypes:
$ mode8 list archetypes
20 archetypes
humanoid_right 64x72 hooded wanderer with a cloak and a staff · side
faces right · rig humanoid · 16 poses
humanoid_left 64x72 hooded wanderer with a cloak and a staff · side
faces left · rig humanoid · 16 poses
quadruped_left 80x56 wolf · side · faces left · rig quadruped
16 poses
quadruped_right 80x56 wolf · side · faces right · rig quadruped
16 poses
boss_quadruped_left 144x144 armored antlered beast · side · faces left
rig boss_quadruped · 17 poses
boss_quadruped_right 144x144 armored antlered beast · side · faces rightShow 30 more lines
rig boss_quadruped · 17 poses
flyer 48x48 bat-winged flyer, hovering · front · rig flyer
9 poses
shrine 48x80 stone shrine with a glowing gem · front
slime 48x40 slime · side · rig blob · 22 poses
knight_right 64x72 armored knight with plumed helm, flowing cloak,
kite shield and sword
side · faces right · rig humanoid · 16 poses
knight_left 64x72 armored knight with plumed helm, flowing cloak,
kite shield and sword
side · faces left · rig humanoid · 16 poses
adventurer_right 64x72 uncloaked adventurer, sword held low · side
faces right · rig humanoid · 16 poses
adventurer_left 64x72 uncloaked adventurer, sword held low · side
faces left · rig humanoid · 16 poses
topdown_hero 48x48 top-down hero with a sword · 3/4 top-down
faces down · rig topdown · 16 poses
portrait_bust 96x96 head-and-shoulders dialogue portrait · 3/4 bust
faces right
isometric_block 96x96 stone house block with a flat roof
2:1 dimetric
isometric_tower 96x120 stone tower with a pyramid roof · 2:1 dimetric
mech_right 96x96 bipedal mech with an arm cannon · side
faces right · rig mech · 16 poses
mech_left 96x96 bipedal mech with an arm cannon · side
faces left · rig mech · 16 poses
starfighter 64x64 starfighter · top-down · faces up · rig vehicle
Next:
mode8 draft knight_right --pose walk_0 --out drafts/hero_walk_0.png
Draw one with mode8 draft. It runs on the CPU in a moment and needs no project:
$ mode8 draft knight_right --out drafts/hero.png
✓ Drafted knight_right (64x72) → drafts/hero.png
Next:
mode8 gen 'armored knight with plumed helm, side view, facing right' --draft drafts/hero.png --out sprites/hero.png # needs ComfyUI
mode8 anim drafts/hero.png --rig humanoid --out-dir frames/hero
mode8 studio .The draft is drawn at the archetype's size (64x72 for the side-view humans) and colored from material ramps. Pass --palette to color it from the palette your game uses (and --size for another size):
$ mode8 draft slime --palette gameboy_dmg --out drafts/slime.png
✓ Drafted slime (48x40) → drafts/slime.png
Next:
mode8 gen 'slime, side view' --draft drafts/slime.png --out sprites/slime.png # needs ComfyUI
mode8 anim drafts/slime.png --rig blob --out-dir frames/slime
mode8 studio .A draft is a guide, not finished art: the shading tells the model where the light comes from, the shapes tell it what goes where. Open it in the Studio and change it before you generate: lengthen a cloak, add a hat, move the sword. The model follows what you draw.
A draft from your own concept#
Have a concept painting or a render from another tool? --source turns any image into a draft: it measures and keys the background, removes a baked ground shadow, crops to the subject, reduces it to --size and reduces its colors.
$ mode8 draft --source ~/Downloads/knight-render.webp --size 64x72 --out drafts/from-concept.png
✓ Drafted drafts/from-concept.png (64x72, 16 colors) from ../Downloads/knight-render.webp
background #8a7664 keyed · reduced 5.8x · baked shadow removed (3420 px)
Next:
mode8 gen SUBJECT --draft drafts/from-concept.png --out sprites/from-concept.png # needs ComfyUI
mode8 studio .
Without --palette, the draft gets 16 colors of its own (--colors changes the count). If the summary says it keyed the wrong color, give the background with --key-color.
Generate#
mode8 gen sends the draft and your prompt to ComfyUI and renders candidates one at a time. Every candidate goes through the same steps:
- Mode 8 finds the pixel grid the model actually drew on, takes one color per art pixel, and reduces the art to the target size only when it is finer (it never scales art up).
- It keys the background to transparency, measured on the render itself.
- It clusters the colors in OKLab, onto your palette or into an automatic one.
- It adds a 1px outline only where the art has none, in its darkest color.
- It checks the result against the measured quality rules of the art type: grid, stray pixels, color budget, leftover background, frames, double outlines and more. Checks lists them.
The best candidate is written to --out. This is the command the knight at the top of this page came from:
$ mode8 gen "armored knight with a crimson cloak and a red plume" --draft drafts/hero.png --palette nes_master_gothic --n 4 --seed 8101 --keep-candidates shots/hero --sheet shots/hero-sheet.png --out sprites/hero.png
✓ Generated sprites/hero.png (64x72)
best of 4 candidates (#1), 4 passed · score 14.478 · 12 colors
preset kleinedit · 2 passes
art 64x72 px on a 12 px grid, kept 1:1
palette fit 0.040 (fair) · pose match 0.89 · fidelity 0.76 · no outline added
review sheet → shots/hero-sheet.png
candidates → shots/hero/
Next:
mode8 anim sprites/hero.png --rig humanoid --out-dir frames/hero
mode8 lint sprites/hero.png --qualityThe summary names the candidate it kept and whether it passes the quality rules. When no candidate passes, Mode 8 still writes the best one, says which rules failed, and exits 1, so a script can tell.
Candidates#
| Flag | What it does |
|---|---|
--n N | Render N candidates, 1 to 16 (default 3). More candidates, better odds, longer wait. |
--seed N | Candidate i uses seed N + i, so a run can be repeated exactly. Without it the seed is random (the report records it). |
--keep-candidates DIR | Keep every candidate (cand_1.png ...) and every raw render (raw_1.png ...) for review. |
--sheet PNG | A zoomed contact sheet of the candidates, side by side, to compare at a glance. |
How the best is chosen: candidates that pass the quality rules come first; among them Mode 8 prefers the one closest to the raw render, with the fewest stray pixels, the best palette fit and a subject that fills its frame. How well the silhouette matches the draft (pose_match) only breaks ties, because a good repaint may move a cloak or a sword. To reject candidates that drift from the pose, set a minimum with --min-pose-match 0.6.
If none of the candidates is the one you want, look at the sheet, then run again with another --seed, or copy the one you like from --keep-candidates: they are finished sprites too.
Prompts#
Describe the subject in plain words: what it is, what it wears, its colors. Leave out "pixel art", "8-bit" and the background: Mode 8 adds the style and the key color itself. With a draft, it wraps your words in an instruction to repaint the blockout as polished, shaded art, and the art type adds its own style cues.
To send your prompt exactly as written, pass --prompt-mode raw.
Palette and colors#
Without --palette, every candidate gets an automatic palette of its own (16 colors for a sprite; --colors changes it). Inside a project, default_palette in mode8.toml is used instead. With a palette, the clusters are mapped onto its colors, and Mode 8 warns when the palette cannot hold the art (a crimson cloak on a palette with no red). Palettes explains the choice.
Outline and background#
Mode 8 adds a 1px outline only where the art has none, in the art's darkest color. --outline-black draws it in pure black instead, and --no-outline-black never adds one.
Transparent art types are rendered on a flat key color that Mode 8 picks far from your palette, then keyed out. --key-color picks the key (magenta, green, cyan ... or #rrggbb), and --bg keep keeps the background, for example for a sprite on its own backdrop.
Art types#
An art type is a profile for what you are making. It sets the preset, the size, whether the background is keyed, the outline and the color count:
$ mode8 list art-types
8 art types
sprite Sprite: 64x72, preset kleinedit, transparent
portrait Portrait / Bust: 96x96, preset style
isometric Isometric Asset: 96x96, preset style, transparent
topdown Top-Down RPG: 48x48, preset kleinedit, transparent
scene Scene / Cutscene / Title: 240x135, preset style
icon Inventory Icon: 32x32, preset style, transparent
pc98 PC-98 Cutscene: 256x160, preset style
vn_bust Visual Novel Bust: 128x160, preset style, transparent
Next:
mode8 gen "red potion" --art-type icon --colors 12 --out potion.pngsprite and topdown repaint a draft (the kleinedit preset). portrait, isometric, scene and icon draw from the prompt alone (the style preset), so they need no draft:
$ mode8 gen "dialogue portrait of a young airship pilot with brass goggles" --art-type portrait --seed 8201 --out portraits/pilot.png
✓ Generated portraits/pilot.png (96x96)
best of 3 candidates (#1), 1 passed · score 15.997 · 24 colors · preset style
art 86x122 px (no pixel grid found), reduced 1.301x
auto palette · fidelity 0.87 · no outline added
rejected: #2 soft or smeared compared to the render, flat or crushed shading; #3 pixels are uneven (upscaled art)
Next:
mode8 anim portraits/pilot.png --rig humanoid --out-dir portraits/frames/pilot
mode8 lint portraits/pilot.png --quality
$ mode8 gen "a small isometric stone cottage with a terracotta tile roof, a wooden door and one lit window, single building, no ground plane" --art-type isometric --seed 8203 --n 4 --out props/cottage.png
✓ Generated props/cottage.png (96x96)
best of 4 candidates (#3), 1 passed · score 15.085 · 24 colors · preset style
art 110x113 px on a 3.3 px grid, reduced 1.202x
auto palette · fidelity 0.79
rejected: #1 looks noisy (isolated pixels), outline drawn twice; #2 looks noisy (isolated pixels); #4 looks noisy (isolated pixels)
Next:
mode8 anim props/cottage.png --rig humanoid --out-dir props/frames/cottage
mode8 lint props/cottage.png --quality
$ mode8 gen "red potion in a round glass flask" --art-type icon --seed 8301 --out icons/potion.png
✓ Generated icons/potion.png (32x32)
best of 3 candidates (#2), 2 passed · score 15.766 · 7 colors · preset style
art 20x31 px on a 7.7 px grid, reduced 1.053x
auto palette · fidelity 0.84
rejected: #3 flat or crushed shading, looks noisy (isolated pixels)
Next:
mode8 anim icons/potion.png --rig humanoid --out-dir icons/frames/potion
mode8 lint icons/potion.png --quality
Every flag you pass wins over the art type's default, so --art-type icon --size 24x24 makes a smaller icon. For terrain, use the procedural tiles of Terrain and props, which tile perfectly and cost no GPU.
Fix one region#
mode8 inpaint repaints only a masked part of a sprite and copies every other pixel from the original byte for byte, so a finished sprite can be changed one region at a time. The mask is a PNG of the sprite's size: white (or opaque) where Mode 8 may repaint.
A part map makes a good mask. Make one for the hero, then a mask of its head (here with a few lines of Python; any image editor or the Studio works as well):
$ mode8 parts sprites/hero.png --rig humanoid --out parts/hero.png
✓ Part map → parts/hero.png (6 parts)
Next:
mode8 anim sprites/hero.png --parts parts/hero.png --rig humanoid --out-dir frames/heroimport json
import os
from PIL import Image
head = json.load(open("parts/hero.json"))["name_to_id"]["head"]
os.makedirs("masks", exist_ok=True)
Image.open("parts/hero.png").point(lambda v: 255 if v == head else 0).save("masks/head.png")$ mode8 inpaint sprites/hero.png "golden helmet with a red plume" --mask masks/head.png --palette nes_master_gothic --out sprites/hero-gold.png
✓ Inpainted sprites/hero-gold.png (64x72)
best of 3 candidates (#1), 3 passed · score 18.342 · preset kleinedit
Next:
mode8 anim sprites/hero-gold.png --rig humanoid --out-dir frames/hero-gold
mode8 lint sprites/hero-gold.png --qualityPixels you painted by hand and want to keep exactly go in a pin mask, --pins. In a project, the Studio keeps the pins of each asset for you.
Pixelize an image you already have#
mode8 pixelize runs the same grid and color steps as gen on any image, with no AI: a render from another tool, a downscaled painting, a screenshot.
$ mode8 pixelize ~/Downloads/knight-render.webp --size 64x72 --bg transparent --out sprites/knight.png
✓ Pixelized → sprites/knight.png (64x72, 14 colors)
art 204x232 px on a 4.7 px grid, reduced 3.222x
auto palette · background #8a7664 keyed
Next:
mode8 lint sprites/knight.png --quality
Without --size, the result keeps the grid the image was drawn on. --palette maps it onto a palette, --colors sets the size of an automatic one, and --preview 4 also writes a copy at 4x for review.
A whole cast#
mode8 cast generates several characters from one manifest, all locked to one style: the first member is generated first and becomes the style reference of the others. Members with a rig are animated and exported too.
{
"palette": "nes_master_gothic",
"members": [
{"name": "knight", "archetype": "knight_right", "prompt": "armored knight with a crimson cloak"},
{"name": "wolf", "archetype": "quadruped_left", "prompt": "lean grey wolf with a dark saddle of fur"},
{"name": "slime", "archetype": "slime", "prompt": "glossy amber slime with two small eyes"}
]
}Check the manifest first. --dry-run validates it and prints the plan without ComfyUI:
$ mode8 cast cast.json --out-dir cast --dry-run
Cast plan: 3 members (dry run, nothing rendered)
knight armored knight with a crimson cloak knight_right
wolf lean grey wolf with a dark saddle of fur quadruped_left
slime glossy amber slime with two small eyes slime
Next:
mode8 cast cast.json --out-dir castThen render it:
$ mode8 cast cast.json --out-dir cast
✓ Cast: 3/3 members passed → cast/When it goes wrong#
- "ComfyUI not reachable" (exit
3): start ComfyUI, or point Mode 8 at it with--comfy-url.mode8 doctorsays what is missing. See Set up local AI. - Soft or smeared candidates: keep them all with
--keep-candidatesand compare at 1x and zoomed; render more with--n, or try another--seed. A sprite much smaller than its render loses detail, and the report'sreductionsays how much. - Faces the wrong way: the sprite follows the draft. Draw the
_leftor_rightarchetype you need; lint'sfacingrule fails a sprite that matches the mirrored draft better. - Colors look wrong on your palette: read the warning. A palette without the colors the subject needs cannot hold it; generate with an automatic palette and choose a palette afterwards, or swap it later with
mode8 recolor.