MCP Tools
Every tool the Mode 8 MCP server offers, with parameter types, defaults, ranges and result keys.
mode8 mcp turns Mode 8 into an MCP server, so an agent can draft, animate, lint, export and co-edit project assets through 31 tools. This page lists every tool and every parameter exactly as the server validates them. Wiring the server into a client is covered in Agents and MCP.
Note
This page is generated from mode8 schema --section mcp and tests/golden/outputs_v1.json by docs/manual/_tools/gen_reference.py. To change it, change Mode 8 (or the prose in the generator) and run the generator with --write; a test fails when this page is out of date.
The server#
- Command:
mode8 mcp(transport: stdio, server namemode8). - Install the optional SDK first:
pip install "mode8[mcp]". - Every tool's input schema refuses unknown arguments (
additionalProperties: false). - Paths are local filesystem paths, resolved by the server process.
Results#
A tool returns one JSON TextContent block, plus base64 PNG ImageContent previews when images are produced. The JSON block is the envelope you know from the CLI, plus the tool name:
{"ok": true, "tool": "<tool name>", "...": "tool report keys"}A failed call:
{"ok": false, "tool": "<tool name>", "error": {"type": "<exception class name>", "msg": "<message>"}}- Invalid arguments -- an unknown or missing argument, or a value that does not match the tool's input_schema (type, enum, range, items) -- report error.type InputError with error.param naming the argument; a missing input path reports NotFoundError with error.path.
- An unknown tool name reports
UnknownToolError. - The other error types and their extras are on Output Envelope and Exit Codes.
Resources#
| URI | Name | Content |
|---|---|---|
mode8://archetypes | archetypes | Supported draft archetypes, tile kinds, and animation rigs: {"ok": true, "archetypes", "tile_kinds", "animated_tile_kinds", "rigs"}. |
mode8://palettes | palettes | Bundled palettes with their RGB hex colors: {"ok": true, "palettes": [...]} (the shape of Studio GET /api/palettes). |
Tools at a glance#
| Tool | What it does |
|---|---|
mode8_draft | Draw a shaded 1x pose blockout PNG of an archetype (side, top-down, portrait, isometric or sci-fi, lit from the top left) from the palette's material ramps: the shape guide for mode8_gen. |
mode8_gen | Generate pixel art via a local ComfyUI server: renders N candidates one at a time, resamples each on its own pixel grid, clusters its colors (onto palette, or an auto palette), gates it with the quality rules and keeps the best; a draft-guided run cleans each candidate up in a second pass on the target pixel grid (passes). |
mode8_inpaint | Regenerate only a masked region of a master sprite via the local ComfyUI (a draft-locked repaint of that region), keeping every pixel outside the mask and every pinned pixel byte-identical. |
mode8_icons | Generate a set of inventory icons that belong together via the local ComfyUI: the first item is drawn from its words (art type icon), every other one by repainting that first icon, so pixel size, outline, palette and light carry over; every icon gets the icon gate (one contour, value steps). |
mode8_anim | Generate zero-boiling, pixel-locked animation frames from an approved master sprite using a built-in rig or a JSON rig file: skeleton rigs move real limb parts (head and torso stay pixel-identical), blob squashes and stretches. |
mode8_tile | Generate a deterministic terrain tile (top-down or side view, seamless variants), prop, weapon, or HUD portrait, colored from the palette's named material ramps. |
mode8_autotile | Generate a blob autotile terrain set from a tile kind (grass, brick, ground_top ...) or a base tile PNG: 16 tiles (blob16, sides) or 47 (blob47, sides and inner corners) with per-terrain edges, plus a Godot 4 TileSet (one terrain with peering bits, a physics layer) and a Tiled .tsx. |
mode8_export | Pack sprite frames into an atlas + JSON, a Godot SpriteFrames .tres, and a preview GIF, and/or engine exports for PixiJS, Phaser 3, LOVE2D, CSS sprites, an indexed palette PNG, or Unity (experimental); per-frame durations (ticks) are honored by every format. |
mode8_maps | Generate 2D lighting maps for sprite frames: a palette-quantized normal map (Godot CanvasTexture-ready) and an emission map for glowing parts (eyes, visors, flames). |
mode8_import | Import existing art into a Mode 8 project as a new asset (journaled as 'agent'): a PNG sprite sheet/strip (auto-detected square strips, cell_size, or a cols x rows grid with margin/spacing), a directory of frame PNGs, or an .ase/.aseprite file (tags become animations). |
mode8_lint | Lint a sprite against the pixel-art contract (binary alpha, size, palette, colors, facing, interior black) with its pose match against a draft (advisory unless min_pose_match); art_type adds the measured quality-bar rules (grid, orphan_ratio, color_budget, key_residue, frame_border, double_outline, subject_fill, ...). |
mode8_pixelize | Pixelize an image on its own pixel grid (the pipeline mode8_gen uses): detect the grid, resample one color per art pixel, key a background (bg='transparent', or the image's own transparency), cluster colors in OKLab onto palette (or an auto palette) and reduce to size when the art is finer (never upsampled). |
mode8_doctor | Check ComfyUI reachability, required node classes and installed models per preset. |
mode8_verify | Verify an exported asset folder against the pixel-art contract and optionally run a headless Godot sprite-tracking probe. |
mode8_check_animation | Deterministic animation stability check: per-frame opaque bbox, foot-plant (bottom row) drift, horizontal center drift and bbox size jitter vs the idle (or first) frame, with an exact integer suggested_offset [dx, dy] that re-plants each frame. |
mode8_recolor | Palette-swap sprites (enemy variants, team colors). |
mode8_fx | Generate deterministic, palette-locked pixel-art effect animations as frame PNGs plus an optional sheet. |
mode8_ui | Generate a deterministic palette-locked 9-slice UI kit (dialog_box, panel, button with normal/hover/pressed/disabled states, slot_frame, health_bar frame/fill, checkbox and radio icons, slider, tabs, tooltip, cursor) in a style colored from the palette's material ramps, with label colors that reach 4.5:1 on their surface, plus a JSON manifest with 9-slice margins and Godot StyleBoxTexture + Theme .tres files (crisp under any filter, with the pixel font, a focus ring, a health-bar scene and a preview scene). |
mode8_font | Export the built-in 5x9 pixel font (95 printable ASCII glyphs, 7 px caps, 2 px descenders, proportional with tabular digits) as an AngelCode BMFont text .fnt + PNG atlas + JSON metrics, with optional outline / drop shadow and integer scale. |
mode8_project_info | Open a Mode 8 project (directory with mode8.toml) and return its config plus a summary of every asset (size, palette, art_type, master_sha256, frames, overrides, stale, can_undo/can_redo). |
mode8_project_get_asset | Read one project asset: sidecar provenance, master_sha256 (pass it back as expected_sha256 when saving), frames, overrides, stale, undo/redo flags and a lint report. |
mode8_project_create_asset | Create a journaled project asset as actor 'agent'. |
mode8_project_save_master | Replace an asset's master.png with an image file as a journaled 'agent' edit. |
mode8_project_save_override | Save a hand-edited animation frame as a sparse per-frame override (diffed against the rig output, journaled as 'agent'). |
mode8_project_history | Recent operation-journal entries (oldest first) for an asset, from every actor (human, agent, cli), plus can_undo/can_redo. |
mode8_project_undo | Undo the most recent operation on an asset (any actor's), journaled as 'agent'. |
mode8_project_redo | Redo the most recently undone operation on an asset, journaled as 'agent'. |
mode8_project_layers | Read an asset's layer stack (bottom → top: id, name, visible, opacity, file, per-layer sha256; null for a flat asset) plus master_sha256. |
mode8_project_save_layer | Write one layer's pixels from an image file as a journaled 'agent' edit; master.png is re-flattened. |
mode8_project_edit_layers | Edit an asset's layer stack as one journaled, undoable 'agent' operation: init (promote the flat master to a one-layer stack), set (name/visible/opacity of layer), reorder (order = ids bottom → top), delete, duplicate, merge_down (composite layer onto the one below) or flatten (drop the stack, keeping master.png). |
mode8_project_init | Scaffold a ready-to-edit Mode 8 project from a starter template (platformer, topdown, isometric, scifi): mode8.toml with the template palette plus deterministic CPU-generated assets (hero with animation frames, tiles, props, UI kit, bitmap font), each journaled as create_asset. |
Pixel tools#
Stateless tools that read and write image files.
mode8_draft#
Draw a shaded 1x pose blockout PNG of an archetype (side, top-down, portrait, isometric or sci-fi, lit from the top left) from the palette's material ramps: the shape guide for mode8_gen. With source, turn any concept render into a draft instead (background keyed, cropped, reduced into size, colors quantized). Returns JSON plus a 4x nearest-neighbor preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
archetype | string or null | What to draw (see the mode8://archetypes resource); omit with source. One of humanoid_right, humanoid_left, quadruped_left, quadruped_right, boss_quadruped_left, boss_quadruped_right, flyer, shrine, slime, knight_right, knight_left, adventurer_right, adventurer_left, topdown_hero, portrait_bust, isometric_block, isometric_tower, mech_right, mech_left, starfighter. | ||
out | string | yes | Output PNG path. | |
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
size | string or array of integer or null | Canvas 'WxH' or [W, H] (default: the archetype's size, e.g. knight 64x72; an archetype's Mode 8 1.0 size is drawn natively too). Required with source. Exactly 2 items. | ||
source | string or null | Concept image to make the draft from (instead of an archetype). | ||
colors | integer or null | With source and no palette: color count (default 16). Range: >= 1. | ||
key_color | string or null | With source: the image's background color '#rrggbb' (default: measured on its border). | ||
pose | string or null | Draw the archetype in this pose instead of at rest, e.g. walk_0, windup, attack, jump, hurt (each archetype's poses: the mode8://archetypes resource; default idle). |
Result keys: archetype, ok, out, size, tool.
mode8_gen#
Generate pixel art via a local ComfyUI server: renders N candidates one at a time, resamples each on its own pixel grid, clusters its colors (onto palette, or an auto palette), gates it with the quality rules and keeps the best; a draft-guided run cleans each candidate up in a second pass on the target pixel grid (passes). art_type picks a genre profile (sprite, portrait, isometric, topdown, scene, icon; terrain tiles are procedural: mode8_tile) for preset/size/background/outline/colors/tiling defaults; explicit options override it. Returns JSON (native_size, reduction, grid_fit, passes, sharpness, palette_fit, pose_match, lint_errors with rule names) plus the contact sheet (or zoomed winner).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | What to draw, in plain words: the subject only (a draft-guided prompt is wrapped in the repaint instruction unless prompt_mode='raw'). | |
out | string | yes | Output PNG path for the winning sprite. | |
palette | string or null | Palette file path or bundled palette name (default: an auto palette of the art type's color count). | ||
art_type | string or null | Art-type profile supplying defaults. One of sprite, portrait, isometric, topdown, scene, icon, pc98, vn_bust. | ||
colors | integer or null | Color clusters: the auto palette's size, or with palette how many clusters map onto it (default: the art type's count: sprite/topdown/icon 16, isometric 24, portrait 32, scene 48). Range: >= 1. | ||
metric | string or null | Color distance for mapping clusters onto palette (default: oklab). One of redmean, oklab. | ||
dither | string or null | Ordered dither, applied only on smooth gradients (default: none). One of none, bayer2, bayer4, checker. | ||
tile_x | boolean or null | Seamless horizontal wrap. | ||
tile_y | boolean or null | Seamless vertical wrap. | ||
bg | string or null | Background: 'transparent' (key the backdrop to alpha), 'fill' (key it, then fill with the palette's darkest neutral) or 'keep' (the backdrop as drawn). Default: from art_type (portrait fill, scene keep, else transparent). One of transparent, fill, keep. | ||
passes | integer or null | Render passes: 2 hands the reduced first repaint back to the model to clean it up on the target pixel grid (sharper, about 30% slower). Default: 2 with a draft, else 1. One of 1, 2. | ||
preset | string or null | kleinedit repaints a draft, style draws from the prompt alone. Default: the art_type preset, else kleinedit. One of kleinedit, style. | ||
draft | string or null | 1x pose draft PNG (required for kleinedit). | ||
ref | string or null | Optional style reference image (kleinedit). | ||
size | string or array of integer or null | Target 'WxH' or [W, H]: finer art is reduced to it, never upsampled (default: the draft size, else the art type's size, e.g. sprite 64x72). Exactly 2 items. | ||
n | integer | 3 | Candidates to render. Range: >= 1, <= 16. | |
seed | integer or null | Base seed; candidate i uses seed + i (default: random). | ||
res | integer or null | Render resolution: the style preset's render size (default: matched to size, about 7 render pixels per art pixel); draft presets: the first-pass canvas (default: 512, 768 or 1024 by draft size). Range: >= 1, <= 4096. | ||
prompt_mode | string | "auto" | auto wraps a draft-guided prompt in the repaint instruction; raw sends it as written. One of auto, raw. | |
min_pose_match | number or null | Fail a candidate whose silhouette matches the draft less than this (default: advisory only, reported as pose_match). Range: >= 0, <= 1. | ||
backend_wait | number or null | Seconds a ComfyUI that stopped answering gets to come back before the run stops, keeping the finished candidates (default 30). Range: >= 0. | ||
outline_black | boolean or null | null (default): a 1px outline only where the art has none, in its darkest color; true: the same in #000000; false: never. | ||
sheet | string or null | Optional contact sheet PNG path. | ||
keep_candidates | string or null | Directory to keep all candidates. | ||
key_color | string or null | "auto" | Key color painted behind the draft: 'auto' (furthest from the palette), a named key candidate, or '#rrggbb'; the real background is measured on each render. | |
comfy_url | string or null | ComfyUI server URL. Default: COMFY_URL, else the comfy_url of the nearest mode8.toml at or above the server's working directory, else http://127.0.0.1:8188. |
mode8_inpaint#
Regenerate only a masked region of a master sprite via the local ComfyUI (a draft-locked repaint of that region), keeping every pixel outside the mask and every pinned pixel byte-identical. Renders N candidates, composites each into the master, lints them on the master's palette and keeps the best. Returns JSON (candidates with changed_pixels, lint_errors) plus the contact sheet (or the zoomed result).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
master | string | yes | Master sprite PNG to edit. | |
mask | string | yes | Mask PNG of the master's size: opaque or bright pixels are the region to regenerate. | |
prompt | string | yes | What the region should become, e.g. 'golden helmet'. | |
palette | string | yes | The master's palette: a bundled name (mode8://palettes) or a palette file path. | |
out | string | yes | Output PNG path for the edited sprite. | |
pins | string or null | Optional pin mask PNG: pixels kept exactly, even inside the mask. | ||
preset | string | "kleinedit" | ComfyUI workflow preset (draft-locked). One of kleinedit. | |
n | integer | 3 | Candidates to render. Range: >= 1, <= 16. | |
seed | integer or null | Base seed; candidate i uses seed + i (default: random). | ||
outline_black | boolean | true | Re-ink the edited region's 1px outer outline in #000000. | |
passes | integer or null | Render passes: 2 hands the reduced first repaint back to the model to clean it up on the master's pixel grid (default: 2). One of 1, 2. | ||
key_tol | integer | 55 | Chroma-key tolerance for the render's background. Range: >= 0, <= 255. | |
sheet | string or null | Optional contact sheet PNG path (original, mask, every candidate). | ||
keep_candidates | string or null | Directory to keep every candidate and raw render. | ||
workflow | string or null | Custom ComfyUI API workflow JSON template path. | ||
comfy_url | string or null | ComfyUI server URL. Default: COMFY_URL, else the comfy_url of the nearest mode8.toml at or above the server's working directory, else http://127.0.0.1:8188. |
mode8_icons#
Generate a set of inventory icons that belong together via the local ComfyUI: the first item is drawn from its words (art type icon), every other one by repainting that first icon, so pixel size, outline, palette and light carry over; every icon gets the icon gate (one contour, value steps). Writes <out_dir>/01_<item>.png, 02_<item>.png ... Returns JSON (icons with pass and failed_rules) plus the sheet (or a strip of the icons).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
items | array of string | yes | What each icon shows, in plain words, e.g. ['red potion', 'iron sword']. 1 to 16 items. | |
out_dir | string | yes | Output directory (created if needed). | |
palette | string or null | Palette file path or bundled palette name (default: an auto palette). | ||
colors | integer or null | Color clusters: the auto palette's size, or with palette how many map onto it (default 16). Range: >= 1. | ||
size | string or array of integer or null | Icon 'WxH' or [W, H] (default 32x32). Exactly 2 items. | ||
n | integer | 2 | Candidates per icon. Range: >= 1, <= 16. | |
seed | integer or null | Base seed (default: random). | ||
sheet | string or null | Optional PNG: one zoomed row of every icon. | ||
keep_candidates | boolean | false | Keep every candidate under <out_dir>/candidates/. | |
comfy_url | string or null | ComfyUI server URL. Default: COMFY_URL, else the comfy_url of the nearest mode8.toml at or above the server's working directory, else http://127.0.0.1:8188. |
mode8_anim#
Generate zero-boiling, pixel-locked animation frames from an approved master sprite using a built-in rig or a JSON rig file: skeleton rigs move real limb parts (head and torso stay pixel-identical), blob squashes and stretches. Animations carry fps, loop and, when frames are held longer, per-frame durations in ticks. The report says the rig method (keyframes / bands / custom), the matched archetype and the fit (iou, mode). Returns JSON plus the animation strip.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
master | string | yes | Master sprite PNG. | |
out_dir | string | yes | Output directory (created if needed). | |
rig | string or null | Built-in proportional rig (see the mode8://archetypes resource). One of humanoid, quadruped, boss_quadruped, flyer, topdown, mech, vehicle, blob. | ||
rig_file | string or null | Custom JSON rig spec (overrides rig). | ||
archetype | string or null | The draft archetype the master was made from (e.g. knight_right): the rig's limbs are placed from it instead of fitted to the silhouette. One of humanoid_right, humanoid_left, quadruped_left, quadruped_right, boss_quadruped_left, boss_quadruped_right, flyer, shrine, slime, knight_right, knight_left, adventurer_right, adventurer_left, topdown_hero, portrait_bust, isometric_block, isometric_tower, mech_right, mech_left, starfighter. | ||
prefix | string or null | Frame file name prefix (default: the master's file name; the asset name for assets/<name>/master.png). | ||
facing | string or null | Direction the master faces (default: the rig's canonical facing). One of left, right. | ||
frames | string or array of string or null | Frame or animation names, e.g. 'idle,walk'. | ||
sheet | string or null | Optional zoomed animation strip PNG path. | ||
sheet_cols | integer | 12 | Contact sheet columns before wrapping to a new row. Range: >= 1. |
Result keys: animations, archetype, facing, fit, frame_names, frames, master, method, ok, rig, rig_file, sheet, size, timing_sidecar, tool.
mode8_tile#
Generate a deterministic terrain tile (top-down or side view, seamless variants), prop, weapon, or HUD portrait, colored from the palette's named material ramps. Returns JSON plus a zoomed preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
kind | string | yes | What to make (see the mode8://archetypes resource: tile_kinds). One of brick, platform, stair_up, stair_down, sconce, gate, signpost, whip, whip_power, knife, flask, shard, heart, hud_portrait, sword, potion, gem, crate, chest, torch, grass, dirt, water, cobble, scifi_panel, iso_tile, tree, coin, energy_cell, ground_top, ground_fill, wall_back, ledge, pillar, stair_step, window_arch, door, stair_step_left, ledge_left, ledge_right, chain, tree_small, bush, rock, flower, iso_grass, iso_paving, iso_tree, iso_crate, iso_chest, iso_house, scifi_door, scifi_stair, scifi_stair_left, catwalk, pipe, vent, hazard_stripe, wall_light, scifi_crate. | |
out | string | yes | Output PNG path. | |
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
size | string or array of integer or null | Optional WxH override, as 'WxH' or [W, H] (positive integers; a canvas Mode 8 creates is at most max_canvas_side per side, see mode8 schema --section limits). Exactly 2 items. | ||
source | string or null | Source sprite PNG (required for hud_portrait). | ||
variant | integer | 0 | Terrain and side-view kinds: which variant to draw (every variant tiles seamlessly with every other). Range: >= 0. | |
variants | integer | 1 | Terrain and side-view kinds: write this many variants (<out>.png, <out>_v1.png, ...); terrain variants are weighted calm / light / feature (the report's weights). Range: >= 1, <= 64. | |
outline_black | boolean | false | Props: draw the 1px contour in #000000 instead of the palette's darkest color. | |
shadow | boolean | false | Props (trees, rocks, chests ...): also write a contact-shadow decal <out>_shadow.png to place under the prop at the same top-left. |
Result keys: animated, classes, files, frames, kind, ok, out, outline, outline_color, seamless, shadow, size, tool, variant, variants, view, weights.
mode8_autotile#
Generate a blob autotile terrain set from a tile kind (grass, brick, ground_top ...) or a base tile PNG: 16 tiles (blob16, sides) or 47 (blob47, sides and inner corners) with per-terrain edges, plus a Godot 4 TileSet (one terrain with peering bits, a physics layer) and a Tiled .tsx. Returns JSON (sheet, tile_count, seam and pixel lint) plus a zoomed preview of the sheet.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | yes | A tile kind (see the mode8://archetypes resource: tile_kinds), a two-terrain transition (grass_dirt, grass_water, dirt_water: the first terrain over the second) or a base tile PNG path. | |
out_dir | string | yes | Output directory (created if needed). | |
name | string | "terrain" | Base name for the written files ([A-Za-z0-9_.-]). | |
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
layout | string | "blob16" | blob16: 16 tiles, 4-neighbor; blob47: 47 tiles with inner corners. One of blob16, blob47. | |
formats | string or array of string or null | "godot,tiled" | Extra exports: godot, tiled (the sheet, its JSON and the base tile are always written). | |
godot_res_prefix | string or null | null | How the Godot resources reference their PNGs: null / 'relative' (default) for paths relative to each .tres/.tscn, which work at any res:// depth, or a res:// folder the files are imported under (e.g. 'res://assets'). | |
border_px | integer | 2 | Edge bevel width inside the contour, in pixels. Range: >= 0. | |
style | string | "auto" | Edge style: grass (blade overhang and cast shadow), dirt (crumbling), water (foam line, 2 frames), curb (cobble curb stones), organic, masonry (brick), plain; auto picks it from the kind. One of auto, organic, masonry, plain, grass, dirt, water, curb. | |
view | string or null | top: edges on all sides; side: a platformer ground with a lip on top (default: side for ground_top / ground_fill, else top). One of top, side. | ||
outline_color | string | "dark" | Edge contour: dark (the terrain's darkest color) or black. One of dark, black. | |
size | string or array of integer or null | Tile size for a tile kind, 'WxH' or [W, H] (default: the kind's size). Exactly 2 items. | ||
variant | integer | 0 | Which terrain variant the interior tiles use. Range: >= 0. | |
interior_variants | integer or null | Tile kinds: interchangeable interior tiles in the sheet, scattered by Godot and Tiled with the variants' weights (default: 8 weighted variants for organic terrain such as grass, dirt and water; else 2 for blob47, 1 for blob16). Range: >= 1, <= 16. | ||
physics | boolean | true | Godot: a physics layer with one collision polygon per tile. | |
occluders | boolean | false | Godot: also a light-occlusion layer. |
Result keys: files, formats, frames, godot, interior_variants, layout, name, ok, out_dir, palette, pass, seam_lint, sheet, sheet_lint, source, source_type, style, terrains, tile_count, tile_size, tiled, tool, view, weights.
mode8_export#
Pack sprite frames into an atlas + JSON, a Godot SpriteFrames .tres, and a preview GIF, and/or engine exports for PixiJS, Phaser 3, LOVE2D, CSS sprites, an indexed palette PNG, or Unity (experimental); per-frame durations (ticks) are honored by every format. With project_root + asset (instead of inputs) it exports that project asset: its frames, recorded animation timing and edited boxes, into godot/art/<asset> (godot, godot_scene) in a Godot starter, else exports/<asset>. Returns JSON plus the atlas image.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
inputs | string or array of string or null | Directory, glob, file prefix, a single PNG, or a list of PNG paths (required unless project_root + asset). | ||
out_dir | string or null | Output directory (created if needed; required unless project_root + asset, whose default is godot/art/<asset> or exports/<asset>). | ||
project_root | string or null | With asset: the Mode 8 project the asset is in. | ||
asset | string or null | With project_root: export this project asset (assets/<asset>/) instead of inputs. | ||
name | string or null | null | Base name for the written files (default: sprite; a project asset: its name). | |
formats | string or array of string or null | null | Comma-separated string or list of: atlas,godot,gif,godot_scene,normal,emission (godot_scene: .tscn with pivot + per-frame hit/hurt boxes; normal: normal-map atlas + CanvasTexture; emission: emission atlas + shader) and the engine formats pixi, phaser, love2d, css, indexed, unity (experimental) (pixi: <name>_pixi.json; phaser: <name>_phaser_atlas.json (atlas + per-frame anchor) + <name>_phaser_anims.json; love2d: <name>.lua; css: <name>.css + <name>_demo.html; indexed: <name>_indexed.png + <name>.hex; unity: <name>_atlas.png.meta + <name>_<anim>.anim clips + <name>.controller; love2d also writes the mode8_sprite.lua runtime). Default: atlas,godot,gif (a project asset in a Godot starter: godot,godot_scene). Items one of atlas, godot, gif, godot_scene, normal, emission, pixi, phaser, love2d, css, indexed, unity. At least 1 item. | |
extrude | integer | 0 | Repeat each frame's edge pixels this far around it in the atlas, so filtering or rounding never samples a neighbour. Range: >= 0, <= 16. | |
power_of_two | boolean | false | Round the atlas sides up to powers of two. | |
box_overrides | string or object or null | godot_scene: hand-edited hurt/hit/body boxes over the computed ones: a Studio boxes.json path or its document {schema: 'mode8.boxes/1', body?, frames: {frame: {hurtbox?, hitbox?}}} (absent = computed, null = none; default: computed, a project asset: its boxes.json). | ||
fps | integer | 8 | Animation frame rate. Range: >= 1, <= 60. | |
gif_scale | integer | 4 | Integer upscale of the GIF previews. Range: >= 1, <= 16. | |
parts | string or null | Optional indexed part map PNG (refines boxes and maps). | ||
bevel | number or string | "auto" | Normal-map bevel radius in pixels, or 'auto' (from the sprite size). Range: > 0. One of auto. | |
relief | number | 2.0 | Normal-map interior relief from the art's own shading, 0..8 (0 = flat bevel only). Range: >= 0, <= 8. | |
levels | integer | 8 | Normal-map quantization levels (0 = unquantized). Range: >= 0. | |
strength | number | 2.0 | Normal-map strength. Range: >= 0. | |
emissive | string or array of string | "auto" | Which pixels glow in the emission map. Presets: 'auto' (light sources only: flames, lamps, neon, effects; never cloth, skin, gold trim or lit surfaces), 'neon' (cool neon / magic hues), 'flame' (warm fire, embers), 'none' (no emission; must stand alone). Custom: '#rrggbb' colors, as a comma-separated string or a list, optionally unioned with presets (e.g. 'neon,#ffcc00'). Tune the preset gate with emissive_min_chroma / emissive_min_lightness and remove colors with emissive_exclude. | |
master | string or null | Optional master PNG the part map was painted on (refines godot_scene boxes). | ||
facing | string or null | Sprite facing (refines godot_scene hitbox detection). One of left, right. | ||
scene_kind | string | "auto" | godot_scene root: character (CharacterBody2D, body fitted to the feet), static (StaticBody2D) or sprite (no physics); auto picks from the animations. One of auto, character, static, sprite. | |
actor_script | boolean | true | godot_scene character: write and attach mode8_actor.gd. | |
gif_transparent | boolean | false | GIFs keep the sprite's transparency (default: a solid backdrop). gif writes <name>_<anim>.gif per animation and <name>.gif (the idle or first loop). | |
godot_res_prefix | string or null | null | How the Godot resources reference their PNGs: null / 'relative' (default) for paths relative to each .tres/.tscn, which work at any res:// depth, or a res:// folder the files are imported under (e.g. 'res://assets'). | |
emissive_min_chroma | number | 0.13 | Minimum OKLab chroma for preset-detected emissive pixels. Range: >= 0. | |
emissive_min_lightness | number | 0.58 | Minimum OKLab lightness (0..1) for preset-detected emissive pixels. Range: >= 0, <= 1. | |
emissive_exclude | string or array of string or null | '#rrggbb' colors that never glow (comma-separated string or list), e.g. a bright skin or UI color. | ||
palette | string or null | Palette file path or bundled palette name for the engine formats (indexed: the exact color table; default: the frames' own colors). | ||
pixels_per_unit | integer or null | Engine option pixels_per_unit for unity: an integral number 1..4096 (32 or 32.0; default 16). Range: >= 1, <= 4096. | ||
guid_namespace | string or null | Engine option guid_namespace for unity: seeds the .meta GUIDs (e.g. the project name) so exports from different projects do not collide. Default: none. | ||
animations | object or null | Animations {anim: {frames: [frame names], fps: positive number, loop: bool, durations?: [ticks per frame]}} (e.g. a project asset's frames.animations, as Studio exports it; durations hold a frame for that many ticks of fps). Default: the mode8 anim timing sidecar beside the frames, else inferred from the frame names. |
Result keys: animations, atlas, css, files, formats, frame_count, frames, gif, godot, indexed, love2d, name, ok, out_dir, phaser, pixi, skipped, sources, timing_sidecar, tool, unity.
mode8_maps#
Generate 2D lighting maps for sprite frames: a palette-quantized normal map (Godot CanvasTexture-ready) and an emission map for glowing parts (eyes, visors, flames). Returns JSON plus an inline preview of the written maps.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
inputs | string or array of string | yes | Sprite PNG, directory of PNGs, or a list of PNG paths. | |
out_dir | string | yes | Output directory (created if needed). | |
parts | string or null | Optional indexed part map PNG. | ||
bevel | number or string | "auto" | Normal-map bevel radius in pixels, or 'auto' (from the sprite size). Range: > 0. One of auto. | |
relief | number | 2.0 | Normal-map interior relief from the art's own shading, 0..8 (0 = flat bevel only). Range: >= 0, <= 8. | |
strength | number | 2.0 | Normal strength. Range: >= 0. | |
levels | integer | 8 | Normal quantization levels (0 = unquantized). Range: >= 0. | |
emissive | string or array of string | "auto" | Which pixels glow in the emission map. Presets: 'auto' (light sources only: flames, lamps, neon, effects; never cloth, skin, gold trim or lit surfaces), 'neon' (cool neon / magic hues), 'flame' (warm fire, embers), 'none' (no emission; must stand alone). Custom: '#rrggbb' colors, as a comma-separated string or a list, optionally unioned with presets (e.g. 'neon,#ffcc00'). Tune the preset gate with emissive_min_chroma / emissive_min_lightness and remove colors with emissive_exclude. | |
name | string or null | Base name for the written files: <name>_n.png / <name>_e.png for a single sprite, <name>_<stem>_n.png / _e.png per sprite when the inputs hold several (default: each sprite's own stem). | ||
emissive_min_chroma | number | 0.13 | Minimum OKLab chroma for preset-detected emissive pixels. Range: >= 0. | |
emissive_min_lightness | number | 0.58 | Minimum OKLab lightness (0..1) for preset-detected emissive pixels. Range: >= 0, <= 1. | |
emissive_exclude | string or array of string or null | '#rrggbb' colors that never glow (comma-separated string or list), e.g. a bright skin or UI color. |
Result keys: bevel, count, emission_files, emissive, emissive_coverage, emissive_exclude, emissive_min_chroma, emissive_min_lightness, emissive_pixels, files, levels, maps, normal_files, ok, out_dir, parts, relief, strength, tool, warnings.
mode8_import#
Import existing art into a Mode 8 project as a new asset (journaled as 'agent'): a PNG sprite sheet/strip (auto-detected square strips, cell_size, or a cols x rows grid with margin/spacing), a directory of frame PNGs, or an .ase/.aseprite file (tags become animations). Initializes mode8.toml when missing and extracts palettes/<name>.gpl unless an existing palette is given. Returns JSON plus the master and frame-strip previews.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | yes | Sprite sheet PNG, directory of frame PNGs, or .ase/.aseprite file. | |
project_root | string | yes | Mode 8 project directory (auto-initialized if needed). | |
name | string | yes | New asset name (assets/<name>/). | |
cell_size | string or array of integer or null | Sheet cell size, as 'WxH' or [W, H]. Exactly 2 items. | ||
cols | integer or null | Sheet grid columns. Range: >= 1. | ||
rows | integer or null | Sheet grid rows. Range: >= 1. | ||
margin | integer | 0 | Sheet border margin. Range: >= 0. | |
spacing | integer | 0 | Pixels between cells. Range: >= 0. | |
keep_empty | boolean | false | Keep fully transparent sheet cells. | |
frame_names | string or array of string or null | One name per imported frame, e.g. 'idle,walk_0'. | ||
palette | string or null | Existing project or bundled palette name; otherwise a palette is extracted from the art. | ||
master_frame | string or null | Frame used as master (default: idle, else first). | ||
fps | integer | 8 | Animation fps for PNG sources (Aseprite files keep their own timing). Range: >= 1, <= 60. | |
art_type | string or null | Art-type profile recorded in the sidecar. One of sprite, portrait, isometric, topdown, scene, icon, pc98, vn_bust. | ||
layers | string | "flatten" | Aseprite sources: 'keep' turns the master frame's layers into the asset's layer stack (layers/layers.json); 'flatten' imports composited pixels only. One of flatten, keep. |
Result keys: animations, asset, fps, frame_count, frames, frames_recorded, layers_imported, layers_mode, master, master_frame, ok, palette, palette_created, palette_path, project_initialized, project_root, size, source, source_info, source_type, tool, warnings.
mode8_lint#
Lint a sprite against the pixel-art contract (binary alpha, size, palette, colors, facing, interior black) with its pose match against a draft (advisory unless min_pose_match); art_type adds the measured quality-bar rules (grid, orphan_ratio, color_budget, key_residue, frame_border, double_outline, subject_fill, ...). Errors carry a rule name and structured pixels [[x, y], ...]. fix=True auto-repairs alpha, stray islands and off-palette pixels first (writes out or in place).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sprite | string | yes | Sprite PNG to check. | |
size | string or array of integer or null | Expected 'WxH' or [W, H] (default: not checked). Exactly 2 items. | ||
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
draft | string or null | Draft PNG the silhouette is compared against (metrics.pose_match). | ||
min_pose_match | number or null | Fail when pose_match is below this (needs draft; default: advisory only). Range: >= 0, <= 1. | ||
art_type | string or null | Apply the quality-bar rules of this art type. One of sprite, topdown, icon, isometric, portrait, scene, pc98, vn_bust, tile. | ||
dither_ok | boolean | false | With art_type: an ordered-dither pattern is intended (skip the dither rule). | |
max_colors | integer or null | Maximum distinct opaque colors. Range: >= 1. | ||
check_interior_black | boolean | false | Fail on #000000 inside the sprite's interior. | |
fix | boolean | false | Repair alpha, stray islands and off-palette pixels before linting. | |
out | string or null | Output path for fix=True (defaults to overwriting sprite). | ||
quality | boolean | false | Also run the advisory pixel-art quality checks (orphan pixels, silhouette jaggies, ramp harmony); warnings never change pass. | |
quality_rules | string or array of string or null | Subset of quality rules (implies quality): orphan_pixels, jaggies, ramp_harmony. Items one of orphan_pixels, jaggies, ramp_harmony. |
Result keys: errors, file, metrics, ok, pass, quality, size, tool, warnings.
mode8_pixelize#
Pixelize an image on its own pixel grid (the pipeline mode8_gen uses): detect the grid, resample one color per art pixel, key a background (bg='transparent', or the image's own transparency), cluster colors in OKLab onto palette (or an auto palette) and reduce to size when the art is finer (never upsampled). Returns JSON (block, native_size, reduction, grid_fit, palette_fit) plus a zoomed preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | yes | Image to pixelize. | |
out | string | yes | Output PNG path. | |
size | string or array of integer or null | Target 'WxH' or [W, H] (default: the detected art-pixel grid). Exactly 2 items. | ||
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
colors | integer or null | Color clusters: the auto palette's size, or with palette how many clusters map onto it (default 16). Range: >= 1. | ||
bg | string or null | 'transparent': key the background measured on the image border to alpha (default: keep the image's own transparency, if any). One of transparent. | ||
metric | string | "oklab" | Color distance for mapping clusters onto palette. One of redmean, oklab. | |
dither | string | "none" | Ordered dither, applied only on smooth gradients. One of none, bayer2, bayer4, checker. | |
despill | boolean | true | Strip key-blended edge pixels of a keyed background before clustering, as mode8_gen does; false keeps them. |
Result keys: block, colors, colors_used, despill, dither, frame_sides, grid_fit, grid_reliable, grid_score, ground_shadow_px, metric, native_size, ok, out, outline_added, outline_share, palette, palette_fit, palette_worst, reduction, size, source, tool, transparent, warnings.
mode8_doctor#
Check ComfyUI reachability, required node classes and installed models per preset. Returns a JSON readiness report (pass summarizes it: reachable and every checked preset ready).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
comfy_url | string or null | Default: COMFY_URL, else the comfy_url of the nearest mode8.toml at or above the server's working directory, else http://127.0.0.1:8188. | ||
preset | string | "all" | ComfyUI preset to check, or 'all'. One of all, kleinedit, style. |
Result keys: comfy_start, comfy_start_source, comfy_url, comfy_url_source, environment, failure, hints, missing_models, missing_nodes, ok, pass, preset_art_types, presets, reachable, setup_commands, tool.
mode8_verify#
Verify an exported asset folder against the pixel-art contract and optionally run a headless Godot sprite-tracking probe. Returns a JSON verification report.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
assets_dir | string or null | Directory of exported pixel-art PNGs to lint (and, with check_anim, frame folders to check). | ||
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
godot_project | string or null | Godot 4 project directory for the live probe (with probe_scene). | ||
probe_scene | string or null | Godot probe scene that prints 'SYNC_CHECK dx=<float>' (with godot_project). | ||
max_dx | number | 2.5 | Max allowed sprite-to-actor drift of the probe, in pixels. | |
render_scene | string or null | With godot_project: render this scene (res://...tscn) headless and check the frame (report godot_render). | ||
render_golden | string or null | With render_scene: PNG the rendered frame must match. | ||
render_frame | integer | 30 | With render_scene: frame to capture, at 60 fps. Range: >= 0. | |
render_max_diff | integer | 0 | With render_golden: pixels allowed to differ. Range: >= 0. | |
check_anim | boolean | false | Also check every frame subdirectory of assets_dir (found recursively) for foot drift / bbox jitter. Requires assets_dir. | |
include_root | boolean | false | With check_anim: also treat loose PNGs directly in assets_dir as one animation (off by default: root sprites are usually unrelated). | |
max_foot_drift | integer or null | null | With check_anim: max foot-line drift in pixels (default null: scaled with the frame height, 2 px up to 36 px tall). Range: >= 0. | |
max_bbox_jitter | integer or null | null | With check_anim: max bbox size/center jitter in pixels (default null: scaled with the frame height, 4 px up to 36 px tall). Range: >= 0. | |
quality | boolean | false | Also run the advisory pixel-art quality checks (orphan pixels, silhouette jaggies, ramp harmony); warnings never change pass. | |
quality_rules | string or array of string or null | Subset of quality rules (implies quality): orphan_pixels, jaggies, ramp_harmony. Items one of orphan_pixels, jaggies, ramp_harmony. |
Result keys: animation_pass, animations, assets_checked, assets_pass, failed_assets, ok, pass, tool.
mode8_check_animation#
Deterministic animation stability check: per-frame opaque bbox, foot-plant (bottom row) drift, horizontal center drift and bbox size jitter vs the idle (or first) frame, with an exact integer suggested_offset [dx, dy] that re-plants each frame. Returns JSON plus a frame strip.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
frames | string or array of string | yes | Directory of PNG frames (natural-sorted) or a list of PNG paths in order. At least 1 item. | |
max_foot_drift | integer or null | null | Max foot-line drift in pixels (default null: scaled with the frame height, 2 px up to 36 px tall). Range: >= 0. | |
max_bbox_jitter | integer or null | null | Max bbox size/center jitter in pixels (default null: scaled with the frame height, 4 px up to 36 px tall). Range: >= 0. |
Result keys: deforming, empty_frames, frame_count, frames, issues, limits_scaled, max_abs_center_drift, max_abs_foot_drift, max_bbox_jitter_allowed, max_foot_drift_allowed, ok, pass, reference, rig, skipped_checks, tool.
mode8_recolor#
Palette-swap sprites (enemy variants, team colors). Without color_map, source colors (source_palette, default: the sprites' own opaque non-black colors) are grouped into hue/neutral ramps and mapped ramp-to-ramp onto target_palette, keeping each color's relative lightness; an explicit color_map wins. The #000000 outline and alpha are untouched. Outputs keep their filename stem, suffixed _<name> when name is given. Returns JSON plus a recolored strip.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
inputs | string or array of string | yes | A directory of PNGs, a single PNG, or a list of PNG paths/directories. | |
out_dir | string | yes | Output directory (created if needed). | |
source_palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
target_palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
color_map | object or string or null | Explicit {'#rrggbb': '#rrggbb'} map (or its JSON string). | ||
name | string or null | Optional output suffix: <stem>_<name>.png ([A-Za-z0-9_.-], starting alphanumeric); with shader, also the shader files' base name (default: sprite). | ||
shader | boolean | false | Also write a Godot 4 palette-swap shader + lookup texture + ShaderMaterial (<name>_palette_swap.gdshader, <name>_palettes.png, <name>_palette_swap.tres), like mode8 recolor --shader. | |
variants | string or object or null | With shader: the variant palettes, as 'name=palette,...' (the CLI --variants syntax) or {name: palette} (default: the target_palette). | ||
godot_res_prefix | string or null | null | With shader: How the Godot resources reference their PNGs: null / 'relative' (default) for paths relative to each .tres/.tscn, which work at any res:// depth, or a res:// folder the files are imported under (e.g. 'res://assets'). |
Result keys: count, files, mapping, mode, name, off_palette_pixels, ok, out_dir, source_palette, target_palette, tool, unmapped_colors.
mode8_fx#
Generate deterministic, palette-locked pixel-art effect animations as frame PNGs plus an optional sheet. Sprite-derived kinds (need source): hitflash, dissolve, spawn, shatter, afterimage, outline_pulse. Standalone kinds: impact, slash_arc, explosion, smoke_puff, sparkle, dust_puff, heal, pickup. Returns JSON plus the sheet or strip.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
kinds | string or array of string | yes | Effect kind(s): a comma list like 'impact,sparkle' or an array. Items one of hitflash, dissolve, spawn, shatter, afterimage, outline_pulse, impact, slash_arc, explosion, smoke_puff, sparkle, dust_puff, heal, pickup. | |
out_dir | string | yes | Output directory (created if needed). | |
source | string or null | Source sprite PNG (required for sprite-derived kinds). | ||
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
frame_count | integer or null | null | Frames per effect (default: 8 for standalone effects, 6 for sprite effects). Range: >= 1, <= 64. | |
outline | string | "ramp" | Standalone effects' contour: 'ramp' (the effect's darkest ramp tone), 'black' (#000000) or 'none'. One of ramp, black, none. | |
size | string or array of integer or null | Canvas WxH for standalone kinds (5..512 per side). Exactly 2 items. | ||
seed | integer | 0 | Random seed (same seed, same output). | |
prefix | string or null | Frame file name prefix put before the effect name: <prefix>_<effect>_00.png ([A-Za-z0-9_.-], no '..'; default: none). | ||
sheet | string or null | Optional sheet PNG path. | ||
sheet_cols | integer | 12 | Contact sheet columns before wrapping to a new row. Range: >= 1. |
Result keys: animations, effects, files, frame_count, frame_names, kinds, ok, out_dir, outline, palette, seed, sheet, source, timing_sidecar, tool.
mode8_ui#
Generate a deterministic palette-locked 9-slice UI kit (dialog_box, panel, button with normal/hover/pressed/disabled states, slot_frame, health_bar frame/fill, checkbox and radio icons, slider, tabs, tooltip, cursor) in a style colored from the palette's material ramps, with label colors that reach 4.5:1 on their surface, plus a JSON manifest with 9-slice margins and Godot StyleBoxTexture + Theme .tres files (crisp under any filter, with the pixel font, a focus ring, a health-bar scene and a preview scene). With source + margins, re-export a hand-edited piece PNG under the kit's names instead. Returns JSON plus the preview, the contact sheet or a strip of the pieces.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
out_dir | string | yes | Output directory (created if needed). | |
kinds | string or array of string or null | "all" | 'all' (default), or UI kinds as a comma-separated string or list: dialog_box, panel, button, slot_frame, health_bar, checkbox, slider, tab, tooltip, cursor (button emits every state, health_bar its frame and fill). An empty value is an error. With source, name the single piece key instead (e.g. 'panel', 'button_hover'). | |
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
style | string | Generated kit style (omitted: bevel; not used with source). One of bevel, flat, rounded, scifi, pc98. | ||
name | string | "ui" | Base file name ([A-Za-z0-9_.-]). | |
formats | string or array of string or null | "png,json,godot" | Outputs, any of png, json, godot. Items one of png, json, godot. At least 1 item. | |
size | string or array of integer or null | Optional 'WxH' or [W, H] override for every requested kind, each side 1..1024 (not used with source). Exactly 2 items. | ||
source | string or null | Hand-edited piece PNG to re-export (requires margins; size and style must be omitted). | ||
margins | string or array of integer or object or null | 9-slice margins for source: 'L,T,R,B', [L, T, R, B] or {left, top, right, bottom} (non-negative integers). Exactly 4 items. | ||
sheet | string or null | Optional labeled contact sheet PNG path. | ||
godot_res_prefix | string or null | null | How the Godot resources reference their PNGs: null / 'relative' (default) for paths relative to each .tres/.tscn, which work at any res:// depth, or a res:// folder the files are imported under (e.g. 'res://assets'). | |
font | string or null | "builtin" | Theme font: 'builtin' (writes <name>_font.png/.fnt, a white tint mask the theme colors), 'none' / null, or a BMFont .fnt path to wire in. | |
materials | object or string or null | Override the style's material ramps per slot (body, accent, bar): {'body': 'stone', 'accent': 'gold'} or 'body=stone,accent=gold' (material names: mode8.ramps.MATERIALS). | ||
studs | boolean | false | bevel style: add the corner stud plates to dialogs and panels. | |
outline_black | boolean | false | Draw the outer contour in #000000 (default: the palette's darkest color). | |
preview | string or null | Also render a mock screen of the kit (dialog, buttons, checkbox, slider, tabs, tooltip, with text) to this PNG; the report measures label centring and contrast. | ||
preview_scale | integer | 3 | With preview: integer zoom of the mock screen. Range: >= 1, <= 16. |
Result keys: files, formats, godot, json, kinds, lint, name, ok, out_dir, outline_black, pass, piece_meta, pieces, source, studs, style, text_colors, tool.
mode8_font#
Export the built-in 5x9 pixel font (95 printable ASCII glyphs, 7 px caps, 2 px descenders, proportional with tabular digits) as an AngelCode BMFont text .fnt + PNG atlas + JSON metrics, with optional outline / drop shadow and integer scale. Output is byte-deterministic. Returns JSON (size = the Godot font size that draws it 1:1) plus the atlas image.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
out_dir | string | yes | Output directory (created if needed). | |
name | string | "font" | Base file name ([A-Za-z0-9_.-]). | |
color | string | "#ffffff" | Glyph color '#rrggbb'. | |
outline | string or null | Optional outline color '#rrggbb'. | ||
shadow | string or null | Optional drop-shadow color '#rrggbb'. | ||
scale | integer | 1 | Integer scale 1..16; an integral number such as 2 or 2.0. Range: >= 1, <= 16. | |
formats | string or array of string or null | "png,fnt,json" | Outputs, any of png, fnt, json (an empty selection is an error; omit for all). Items one of png, fnt, json. At least 1 item. | |
mono | boolean | false | Monospaced: every glyph advances the same width (default: proportional). | |
charset | string | "latin1" | Glyphs to export: 'latin1' (ASCII plus the Latin-1 letters and signs, 191 glyphs) or 'ascii' (95). One of latin1, ascii. | |
kern | boolean | true | Write the kerning pairs (AV, To, Yo ...) into the .fnt. |
Result keys: atlas_size, charset, files, fnt, glyph_count, json, kerning_pairs, line_height, mono, name, ok, out_dir, png, scale, size, tool.
Project tools#
Tools that open a Mode 8 project (a directory with mode8.toml) and edit its assets as journaled, undoable agent operations. See Humans and Agents for how they co-exist with Studio edits.
mode8_project_info#
Open a Mode 8 project (directory with mode8.toml) and return its config plus a summary of every asset (size, palette, art_type, master_sha256, frames, overrides, stale, can_undo/can_redo).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). |
Result keys: asset_count, assets, config, ok, project_root, tool.
mode8_project_get_asset#
Read one project asset: sidecar provenance, master_sha256 (pass it back as expected_sha256 when saving), frames, overrides, stale, undo/redo flags and a lint report. Returns JSON plus zoomed master (and draft) previews.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). |
Result keys: can_redo, can_undo, frames, has_draft, has_parts, has_pins, has_rig, layers, lint, master_sha256, name, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, overrides, palette, palette_path, path, sidecar, size, stale, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_create_asset#
Create a journaled project asset as actor 'agent'. With an archetype, builds a 1x pose draft and a 1px-outlined master from it (as Mode 8 Studio does); otherwise a blank master. Returns JSON plus a zoomed preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
name | string | yes | New asset name (letters, digits, '_', '-', '.'). | |
archetype | string or null | Archetype draft to start the asset from (omit for a blank master). One of humanoid_right, humanoid_left, quadruped_left, quadruped_right, boss_quadruped_left, boss_quadruped_right, flyer, shrine, slime, knight_right, knight_left, adventurer_right, adventurer_left, topdown_hero, portrait_bust, isometric_block, isometric_tower, mech_right, mech_left, starfighter. | ||
palette | string or null | Palette file path or bundled palette name (see mode8://palettes). | ||
size | string or array of integer or null | Optional WxH override, as 'WxH' or [W, H] (positive integers; a canvas Mode 8 creates is at most max_canvas_side per side, see mode8 schema --section limits). Exactly 2 items. | ||
art_type | string or null | Art-type profile recorded in the asset's sidecar. One of sprite, portrait, isometric, topdown, scene, icon, pc98, vn_bust. |
Result keys: can_redo, can_undo, created, frames, has_draft, has_parts, has_pins, has_rig, layers, lint, master_sha256, name, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, overrides, palette, palette_path, path, sidecar, size, stale, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_save_master#
Replace an asset's master.png with an image file as a journaled 'agent' edit. Pass expected_sha256 (from mode8_project_get_asset) for optimistic concurrency: if a human changed the master meanwhile, a ConflictError with expected vs actual SHA-256 is returned and nothing is written. respect_pins keeps human-pinned pixels (pins.png). Layered assets are refused unless on_layers='flatten' (edit layers with mode8_project_save_layer). Returns the new SHA-256, lint report and a preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). | |
image_path | string | yes | RGBA PNG holding the new master. | |
expected_sha256 | string or null | SHA-256 of the master you edited. | ||
op | string | "agent_edit" | Journal operation label. | |
respect_pins | boolean | true | Keep human-pinned pixels (pins.png) from the previous pixels. | |
on_layers | string | "error" | On a layered asset: 'error' refuses (structured error with layered/layer_count; use mode8_project_save_layer instead), 'flatten' replaces the master and drops the layer stack in one undoable entry. One of error, flatten. |
Result keys: asset, can_redo, can_undo, entry_id, lint, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, op, pinned_pixels, pinned_preserved, previous_sha256, respect_pins, sha256, stale, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_save_override#
Save a hand-edited animation frame as a sparse per-frame override (diffed against the rig output, journaled as 'agent'). Returns override stats plus the composed frame preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). | |
frame | string | yes | Frame name (frames/<frame>.png). | |
image_path | string | yes | Edited full frame PNG (same size as the frame). |
Result keys: asset, can_redo, can_undo, entry_id, erase_pixels, frame, frame_sha256, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, override_sha256, override_stats, paint_pixels, pixels, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_history#
Recent operation-journal entries (oldest first) for an asset, from every actor (human, agent, cli), plus can_undo/can_redo.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). | |
limit | integer | 20 | How many entries to return (newest last). Range: >= 1, <= 500. |
Result keys: asset, can_redo, can_undo, count, entries, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_undo#
Undo the most recent operation on an asset (any actor's), journaled as 'agent'. Returns the updated asset summary plus a master preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). |
Result keys: action, actor, asset, can_redo, can_undo, drift, entry_id, exists, lint, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, op, sha256, summary, switch_to, tool, undo_deletes_asset, undo_restores_asset, undoes.
mode8_project_redo#
Redo the most recently undone operation on an asset, journaled as 'agent'. Returns the updated asset summary plus a master preview.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). |
Result keys: action, actor, asset, can_redo, can_undo, drift, entry_id, exists, lint, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, op, redoes, sha256, summary, switch_to, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_layers#
Read an asset's layer stack (bottom → top: id, name, visible, opacity, file, per-layer sha256; null for a flat asset) plus master_sha256. Returns JSON plus the flattened master preview and a per-layer contact sheet.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). |
Result keys: asset, can_redo, can_undo, layer_count, layered, layers, master_sha256, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_save_layer#
Write one layer's pixels from an image file as a journaled 'agent' edit; master.png is re-flattened. Omit layer_id to add a new layer (a flat asset is promoted to a stack, its master becoming layer 'base') at position top|bottom|above:<id>|below:<id>; pass layer_id=<id> to replace that layer's pixels (plus optional name/visible/opacity). respect_pins keeps human-pinned pixels (pins.png) from the layer's previous pixels (transparent for a new layer) and reports pinned_preserved. expected_sha256 guards the master, expected_layer_sha256 the layer; stale hashes return a ConflictError and nothing is written.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). | |
image_path | string | yes | RGBA PNG of the layer (canvas size). | |
layer_id | string or null | Existing layer id to replace; omit to add a new layer. | ||
name | string or null | Layer display name (1-128 printable characters). | ||
position | string | "top" | New layers only: 'top', 'bottom', 'above:<id>' or 'below:<id>'. | |
visible | boolean or null | Layer visibility (hidden layers are not flattened). | ||
opacity | integer or null | Layer opacity 0..255. Range: >= 0, <= 255. | ||
expected_sha256 | string or null | SHA-256 of the master you edited. | ||
expected_layer_sha256 | string or null | SHA-256 of the layer PNG you edited (from mode8_project_layers). | ||
respect_pins | boolean | true | Keep human-pinned pixels (pins.png) from the previous pixels. |
Result keys: asset, can_redo, can_undo, created, entries, entry_id, index, layer_count, layer_id, layer_sha256, layered, layers, lint, master_sha256, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, pinned_pixels, pinned_preserved, previous_sha256, respect_pins, sha256, stale, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_edit_layers#
Edit an asset's layer stack as one journaled, undoable 'agent' operation: init (promote the flat master to a one-layer stack), set (name/visible/opacity of layer), reorder (order = ids bottom → top), delete, duplicate, merge_down (composite layer onto the one below) or flatten (drop the stack, keeping master.png). Returns the updated stack JSON plus master and layer previews.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Mode 8 project directory (contains mode8.toml). | |
asset | string | yes | Asset name (assets/<name>/). | |
action | string | yes | Layer-stack operation. One of init, set, reorder, delete, duplicate, merge_down, flatten. | |
layer_id | string or null | Target layer id (set, delete, duplicate, merge_down). | ||
name | string or null | set: new layer name; init: base layer name (default Base). | ||
visible | boolean or null | Layer visibility (hidden layers are not flattened). | ||
opacity | integer or null | Layer opacity 0..255. Range: >= 0, <= 255. | ||
order | string or array of string or null | reorder: every layer id, bottom → top. | ||
expected_sha256 | string or null | SHA-256 of the master you read. |
Result keys: action, asset, can_redo, can_undo, entry_id, layer_count, layer_id, layered, layers, master_sha256, merged, next_redo_label, next_redo_op, next_undo_label, next_undo_op, ok, previous_sha256, sha256, stale, tool, undo_deletes_asset, undo_restores_asset.
mode8_project_init#
Scaffold a ready-to-edit Mode 8 project from a starter template (platformer, topdown, isometric, scifi): mode8.toml with the template palette plus deterministic CPU-generated assets (hero with animation frames, tiles, props, UI kit, bitmap font), each journaled as create_asset. Existing assets are skipped unless force=true. Returns the scaffold report (assets, skipped, next commands) plus a strip of the asset masters. With refresh_godot=true (no template), re-export an existing starter's art into its godot/ folder instead (project.godot, scenes, scripts, tiles, UI kit and font are kept).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_root | string | yes | Project directory to create or complete. | |
template | string or null | Starter template to scaffold (required unless refresh_godot). One of platformer, topdown, isometric, scifi. | ||
name | string or null | Project name (default: the directory name). | ||
force | boolean | false | Overwrite existing template assets instead of skipping them. | |
refresh_godot | boolean | false | Re-export an existing starter's art into godot/ with this Mode 8 (actors, animated fixtures, props) and change nothing else. | |
assets | string or array of string or null | With refresh_godot: only these asset names (default: every asset that has a Godot export). |
Result keys: assets, godot, lint, next, ok, outputs, palette, palette_path, palette_variants, pass, preview, project_palette, project_root, readme, reset, skipped, template, tool, warnings.
See also#
- Agents and MCP to connect the server to Claude Code or another client.
- CLI Reference: every tool has a matching CLI command with the same names in kebab-case.
- Output Envelope and Exit Codes for error types and extras.