Manual Reference

On this page
  1. The server
  2. Results
  3. Resources
  4. Tools at a glance
  5. Pixel tools
  6. mode8_draft
  7. mode8_gen
  8. mode8_inpaint
  9. mode8_icons
  10. mode8_anim
  11. mode8_tile
  12. mode8_autotile
  13. mode8_export
  14. mode8_maps
  15. mode8_import
  16. mode8_lint
  17. mode8_pixelize
  18. mode8_doctor
  19. mode8_verify
  20. mode8_check_animation
  21. mode8_recolor
  22. mode8_fx
  23. mode8_ui
  24. mode8_font
  25. Project tools
  26. mode8_project_info
  27. mode8_project_get_asset
  28. mode8_project_create_asset
  29. mode8_project_save_master
  30. mode8_project_save_override
  31. mode8_project_history
  32. mode8_project_undo
  33. mode8_project_redo
  34. mode8_project_layers
  35. mode8_project_save_layer
  36. mode8_project_edit_layers
  37. mode8_project_init
  38. See also

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 name mode8).
  • 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:

json
{"ok": true, "tool": "<tool name>", "...": "tool report keys"}

A failed call:

json
{"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#

URINameContent
mode8://archetypesarchetypesSupported draft archetypes, tile kinds, and animation rigs: {"ok": true, "archetypes", "tile_kinds", "animated_tile_kinds", "rigs"}.
mode8://palettespalettesBundled palettes with their RGB hex colors: {"ok": true, "palettes": [...]} (the shape of Studio GET /api/palettes).

Tools at a glance#

ToolWhat it does
mode8_draftDraw 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_genGenerate 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_inpaintRegenerate 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_iconsGenerate 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_animGenerate 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_tileGenerate 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_autotileGenerate 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_exportPack 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_mapsGenerate 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_importImport 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_lintLint 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_pixelizePixelize 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_doctorCheck ComfyUI reachability, required node classes and installed models per preset.
mode8_verifyVerify an exported asset folder against the pixel-art contract and optionally run a headless Godot sprite-tracking probe.
mode8_check_animationDeterministic 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_recolorPalette-swap sprites (enemy variants, team colors).
mode8_fxGenerate deterministic, palette-locked pixel-art effect animations as frame PNGs plus an optional sheet.
mode8_uiGenerate 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_fontExport 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_infoOpen 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_assetRead 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_assetCreate a journaled project asset as actor 'agent'.
mode8_project_save_masterReplace an asset's master.png with an image file as a journaled 'agent' edit.
mode8_project_save_overrideSave a hand-edited animation frame as a sparse per-frame override (diffed against the rig output, journaled as 'agent').
mode8_project_historyRecent operation-journal entries (oldest first) for an asset, from every actor (human, agent, cli), plus can_undo/can_redo.
mode8_project_undoUndo the most recent operation on an asset (any actor's), journaled as 'agent'.
mode8_project_redoRedo the most recently undone operation on an asset, journaled as 'agent'.
mode8_project_layersRead 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_layerWrite one layer's pixels from an image file as a journaled 'agent' edit; master.png is re-flattened.
mode8_project_edit_layersEdit 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_initScaffold 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.

ParameterTypeRequiredDefaultDescription
archetypestring or nullWhat 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.
outstringyesOutput PNG path.
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
sizestring or array of integer or nullCanvas '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.
sourcestring or nullConcept image to make the draft from (instead of an archetype).
colorsinteger or nullWith source and no palette: color count (default 16). Range: >= 1.
key_colorstring or nullWith source: the image's background color '#rrggbb' (default: measured on its border).
posestring or nullDraw 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).

ParameterTypeRequiredDefaultDescription
promptstringyesWhat to draw, in plain words: the subject only (a draft-guided prompt is wrapped in the repaint instruction unless prompt_mode='raw').
outstringyesOutput PNG path for the winning sprite.
palettestring or nullPalette file path or bundled palette name (default: an auto palette of the art type's color count).
art_typestring or nullArt-type profile supplying defaults. One of sprite, portrait, isometric, topdown, scene, icon, pc98, vn_bust.
colorsinteger or nullColor 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.
metricstring or nullColor distance for mapping clusters onto palette (default: oklab). One of redmean, oklab.
ditherstring or nullOrdered dither, applied only on smooth gradients (default: none). One of none, bayer2, bayer4, checker.
tile_xboolean or nullSeamless horizontal wrap.
tile_yboolean or nullSeamless vertical wrap.
bgstring or nullBackground: '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.
passesinteger or nullRender 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.
presetstring or nullkleinedit repaints a draft, style draws from the prompt alone. Default: the art_type preset, else kleinedit. One of kleinedit, style.
draftstring or null1x pose draft PNG (required for kleinedit).
refstring or nullOptional style reference image (kleinedit).
sizestring or array of integer or nullTarget '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.
ninteger3Candidates to render. Range: >= 1, <= 16.
seedinteger or nullBase seed; candidate i uses seed + i (default: random).
resinteger or nullRender 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_modestring"auto"auto wraps a draft-guided prompt in the repaint instruction; raw sends it as written. One of auto, raw.
min_pose_matchnumber or nullFail a candidate whose silhouette matches the draft less than this (default: advisory only, reported as pose_match). Range: >= 0, <= 1.
backend_waitnumber or nullSeconds a ComfyUI that stopped answering gets to come back before the run stops, keeping the finished candidates (default 30). Range: >= 0.
outline_blackboolean or nullnull (default): a 1px outline only where the art has none, in its darkest color; true: the same in #000000; false: never.
sheetstring or nullOptional contact sheet PNG path.
keep_candidatesstring or nullDirectory to keep all candidates.
key_colorstring 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_urlstring or nullComfyUI 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).

ParameterTypeRequiredDefaultDescription
masterstringyesMaster sprite PNG to edit.
maskstringyesMask PNG of the master's size: opaque or bright pixels are the region to regenerate.
promptstringyesWhat the region should become, e.g. 'golden helmet'.
palettestringyesThe master's palette: a bundled name (mode8://palettes) or a palette file path.
outstringyesOutput PNG path for the edited sprite.
pinsstring or nullOptional pin mask PNG: pixels kept exactly, even inside the mask.
presetstring"kleinedit"ComfyUI workflow preset (draft-locked). One of kleinedit.
ninteger3Candidates to render. Range: >= 1, <= 16.
seedinteger or nullBase seed; candidate i uses seed + i (default: random).
outline_blackbooleantrueRe-ink the edited region's 1px outer outline in #000000.
passesinteger or nullRender 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_tolinteger55Chroma-key tolerance for the render's background. Range: >= 0, <= 255.
sheetstring or nullOptional contact sheet PNG path (original, mask, every candidate).
keep_candidatesstring or nullDirectory to keep every candidate and raw render.
workflowstring or nullCustom ComfyUI API workflow JSON template path.
comfy_urlstring or nullComfyUI 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).

ParameterTypeRequiredDefaultDescription
itemsarray of stringyesWhat each icon shows, in plain words, e.g. ['red potion', 'iron sword']. 1 to 16 items.
out_dirstringyesOutput directory (created if needed).
palettestring or nullPalette file path or bundled palette name (default: an auto palette).
colorsinteger or nullColor clusters: the auto palette's size, or with palette how many map onto it (default 16). Range: >= 1.
sizestring or array of integer or nullIcon 'WxH' or [W, H] (default 32x32). Exactly 2 items.
ninteger2Candidates per icon. Range: >= 1, <= 16.
seedinteger or nullBase seed (default: random).
sheetstring or nullOptional PNG: one zoomed row of every icon.
keep_candidatesbooleanfalseKeep every candidate under <out_dir>/candidates/.
comfy_urlstring or nullComfyUI 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.

ParameterTypeRequiredDefaultDescription
masterstringyesMaster sprite PNG.
out_dirstringyesOutput directory (created if needed).
rigstring or nullBuilt-in proportional rig (see the mode8://archetypes resource). One of humanoid, quadruped, boss_quadruped, flyer, topdown, mech, vehicle, blob.
rig_filestring or nullCustom JSON rig spec (overrides rig).
archetypestring or nullThe 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.
prefixstring or nullFrame file name prefix (default: the master's file name; the asset name for assets/<name>/master.png).
facingstring or nullDirection the master faces (default: the rig's canonical facing). One of left, right.
framesstring or array of string or nullFrame or animation names, e.g. 'idle,walk'.
sheetstring or nullOptional zoomed animation strip PNG path.
sheet_colsinteger12Contact 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.

ParameterTypeRequiredDefaultDescription
kindstringyesWhat 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.
outstringyesOutput PNG path.
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
sizestring or array of integer or nullOptional 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.
sourcestring or nullSource sprite PNG (required for hud_portrait).
variantinteger0Terrain and side-view kinds: which variant to draw (every variant tiles seamlessly with every other). Range: >= 0.
variantsinteger1Terrain 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_blackbooleanfalseProps: draw the 1px contour in #000000 instead of the palette's darkest color.
shadowbooleanfalseProps (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.

ParameterTypeRequiredDefaultDescription
sourcestringyesA 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_dirstringyesOutput directory (created if needed).
namestring"terrain"Base name for the written files ([A-Za-z0-9_.-]).
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
layoutstring"blob16"blob16: 16 tiles, 4-neighbor; blob47: 47 tiles with inner corners. One of blob16, blob47.
formatsstring 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_prefixstring or nullnullHow 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_pxinteger2Edge bevel width inside the contour, in pixels. Range: >= 0.
stylestring"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.
viewstring or nulltop: 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_colorstring"dark"Edge contour: dark (the terrain's darkest color) or black. One of dark, black.
sizestring or array of integer or nullTile size for a tile kind, 'WxH' or [W, H] (default: the kind's size). Exactly 2 items.
variantinteger0Which terrain variant the interior tiles use. Range: >= 0.
interior_variantsinteger or nullTile 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.
physicsbooleantrueGodot: a physics layer with one collision polygon per tile.
occludersbooleanfalseGodot: 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.

ParameterTypeRequiredDefaultDescription
inputsstring or array of string or nullDirectory, glob, file prefix, a single PNG, or a list of PNG paths (required unless project_root + asset).
out_dirstring or nullOutput directory (created if needed; required unless project_root + asset, whose default is godot/art/<asset> or exports/<asset>).
project_rootstring or nullWith asset: the Mode 8 project the asset is in.
assetstring or nullWith project_root: export this project asset (assets/<asset>/) instead of inputs.
namestring or nullnullBase name for the written files (default: sprite; a project asset: its name).
formatsstring or array of string or nullnullComma-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.
extrudeinteger0Repeat 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_twobooleanfalseRound the atlas sides up to powers of two.
box_overridesstring or object or nullgodot_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).
fpsinteger8Animation frame rate. Range: >= 1, <= 60.
gif_scaleinteger4Integer upscale of the GIF previews. Range: >= 1, <= 16.
partsstring or nullOptional indexed part map PNG (refines boxes and maps).
bevelnumber or string"auto"Normal-map bevel radius in pixels, or 'auto' (from the sprite size). Range: > 0. One of auto.
reliefnumber2.0Normal-map interior relief from the art's own shading, 0..8 (0 = flat bevel only). Range: >= 0, <= 8.
levelsinteger8Normal-map quantization levels (0 = unquantized). Range: >= 0.
strengthnumber2.0Normal-map strength. Range: >= 0.
emissivestring 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.
masterstring or nullOptional master PNG the part map was painted on (refines godot_scene boxes).
facingstring or nullSprite facing (refines godot_scene hitbox detection). One of left, right.
scene_kindstring"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_scriptbooleantruegodot_scene character: write and attach mode8_actor.gd.
gif_transparentbooleanfalseGIFs 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_prefixstring or nullnullHow 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_chromanumber0.13Minimum OKLab chroma for preset-detected emissive pixels. Range: >= 0.
emissive_min_lightnessnumber0.58Minimum OKLab lightness (0..1) for preset-detected emissive pixels. Range: >= 0, <= 1.
emissive_excludestring or array of string or null'#rrggbb' colors that never glow (comma-separated string or list), e.g. a bright skin or UI color.
palettestring or nullPalette file path or bundled palette name for the engine formats (indexed: the exact color table; default: the frames' own colors).
pixels_per_unitinteger or nullEngine option pixels_per_unit for unity: an integral number 1..4096 (32 or 32.0; default 16). Range: >= 1, <= 4096.
guid_namespacestring or nullEngine option guid_namespace for unity: seeds the .meta GUIDs (e.g. the project name) so exports from different projects do not collide. Default: none.
animationsobject or nullAnimations {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.

ParameterTypeRequiredDefaultDescription
inputsstring or array of stringyesSprite PNG, directory of PNGs, or a list of PNG paths.
out_dirstringyesOutput directory (created if needed).
partsstring or nullOptional indexed part map PNG.
bevelnumber or string"auto"Normal-map bevel radius in pixels, or 'auto' (from the sprite size). Range: > 0. One of auto.
reliefnumber2.0Normal-map interior relief from the art's own shading, 0..8 (0 = flat bevel only). Range: >= 0, <= 8.
strengthnumber2.0Normal strength. Range: >= 0.
levelsinteger8Normal quantization levels (0 = unquantized). Range: >= 0.
emissivestring 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.
namestring or nullBase 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_chromanumber0.13Minimum OKLab chroma for preset-detected emissive pixels. Range: >= 0.
emissive_min_lightnessnumber0.58Minimum OKLab lightness (0..1) for preset-detected emissive pixels. Range: >= 0, <= 1.
emissive_excludestring 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.

ParameterTypeRequiredDefaultDescription
sourcestringyesSprite sheet PNG, directory of frame PNGs, or .ase/.aseprite file.
project_rootstringyesMode 8 project directory (auto-initialized if needed).
namestringyesNew asset name (assets/<name>/).
cell_sizestring or array of integer or nullSheet cell size, as 'WxH' or [W, H]. Exactly 2 items.
colsinteger or nullSheet grid columns. Range: >= 1.
rowsinteger or nullSheet grid rows. Range: >= 1.
margininteger0Sheet border margin. Range: >= 0.
spacinginteger0Pixels between cells. Range: >= 0.
keep_emptybooleanfalseKeep fully transparent sheet cells.
frame_namesstring or array of string or nullOne name per imported frame, e.g. 'idle,walk_0'.
palettestring or nullExisting project or bundled palette name; otherwise a palette is extracted from the art.
master_framestring or nullFrame used as master (default: idle, else first).
fpsinteger8Animation fps for PNG sources (Aseprite files keep their own timing). Range: >= 1, <= 60.
art_typestring or nullArt-type profile recorded in the sidecar. One of sprite, portrait, isometric, topdown, scene, icon, pc98, vn_bust.
layersstring"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).

ParameterTypeRequiredDefaultDescription
spritestringyesSprite PNG to check.
sizestring or array of integer or nullExpected 'WxH' or [W, H] (default: not checked). Exactly 2 items.
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
draftstring or nullDraft PNG the silhouette is compared against (metrics.pose_match).
min_pose_matchnumber or nullFail when pose_match is below this (needs draft; default: advisory only). Range: >= 0, <= 1.
art_typestring or nullApply the quality-bar rules of this art type. One of sprite, topdown, icon, isometric, portrait, scene, pc98, vn_bust, tile.
dither_okbooleanfalseWith art_type: an ordered-dither pattern is intended (skip the dither rule).
max_colorsinteger or nullMaximum distinct opaque colors. Range: >= 1.
check_interior_blackbooleanfalseFail on #000000 inside the sprite's interior.
fixbooleanfalseRepair alpha, stray islands and off-palette pixels before linting.
outstring or nullOutput path for fix=True (defaults to overwriting sprite).
qualitybooleanfalseAlso run the advisory pixel-art quality checks (orphan pixels, silhouette jaggies, ramp harmony); warnings never change pass.
quality_rulesstring or array of string or nullSubset 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.

ParameterTypeRequiredDefaultDescription
sourcestringyesImage to pixelize.
outstringyesOutput PNG path.
sizestring or array of integer or nullTarget 'WxH' or [W, H] (default: the detected art-pixel grid). Exactly 2 items.
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
colorsinteger or nullColor clusters: the auto palette's size, or with palette how many clusters map onto it (default 16). Range: >= 1.
bgstring 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.
metricstring"oklab"Color distance for mapping clusters onto palette. One of redmean, oklab.
ditherstring"none"Ordered dither, applied only on smooth gradients. One of none, bayer2, bayer4, checker.
despillbooleantrueStrip 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).

ParameterTypeRequiredDefaultDescription
comfy_urlstring or nullDefault: 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.
presetstring"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.

ParameterTypeRequiredDefaultDescription
assets_dirstring or nullDirectory of exported pixel-art PNGs to lint (and, with check_anim, frame folders to check).
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
godot_projectstring or nullGodot 4 project directory for the live probe (with probe_scene).
probe_scenestring or nullGodot probe scene that prints 'SYNC_CHECK dx=<float>' (with godot_project).
max_dxnumber2.5Max allowed sprite-to-actor drift of the probe, in pixels.
render_scenestring or nullWith godot_project: render this scene (res://...tscn) headless and check the frame (report godot_render).
render_goldenstring or nullWith render_scene: PNG the rendered frame must match.
render_frameinteger30With render_scene: frame to capture, at 60 fps. Range: >= 0.
render_max_diffinteger0With render_golden: pixels allowed to differ. Range: >= 0.
check_animbooleanfalseAlso check every frame subdirectory of assets_dir (found recursively) for foot drift / bbox jitter. Requires assets_dir.
include_rootbooleanfalseWith check_anim: also treat loose PNGs directly in assets_dir as one animation (off by default: root sprites are usually unrelated).
max_foot_driftinteger or nullnullWith 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_jitterinteger or nullnullWith 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.
qualitybooleanfalseAlso run the advisory pixel-art quality checks (orphan pixels, silhouette jaggies, ramp harmony); warnings never change pass.
quality_rulesstring or array of string or nullSubset 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.

ParameterTypeRequiredDefaultDescription
framesstring or array of stringyesDirectory of PNG frames (natural-sorted) or a list of PNG paths in order. At least 1 item.
max_foot_driftinteger or nullnullMax foot-line drift in pixels (default null: scaled with the frame height, 2 px up to 36 px tall). Range: >= 0.
max_bbox_jitterinteger or nullnullMax 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.

ParameterTypeRequiredDefaultDescription
inputsstring or array of stringyesA directory of PNGs, a single PNG, or a list of PNG paths/directories.
out_dirstringyesOutput directory (created if needed).
source_palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
target_palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
color_mapobject or string or nullExplicit {'#rrggbb': '#rrggbb'} map (or its JSON string).
namestring or nullOptional output suffix: <stem>_<name>.png ([A-Za-z0-9_.-], starting alphanumeric); with shader, also the shader files' base name (default: sprite).
shaderbooleanfalseAlso 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.
variantsstring or object or nullWith shader: the variant palettes, as 'name=palette,...' (the CLI --variants syntax) or {name: palette} (default: the target_palette).
godot_res_prefixstring or nullnullWith 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.

ParameterTypeRequiredDefaultDescription
kindsstring or array of stringyesEffect 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_dirstringyesOutput directory (created if needed).
sourcestring or nullSource sprite PNG (required for sprite-derived kinds).
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
frame_countinteger or nullnullFrames per effect (default: 8 for standalone effects, 6 for sprite effects). Range: >= 1, <= 64.
outlinestring"ramp"Standalone effects' contour: 'ramp' (the effect's darkest ramp tone), 'black' (#000000) or 'none'. One of ramp, black, none.
sizestring or array of integer or nullCanvas WxH for standalone kinds (5..512 per side). Exactly 2 items.
seedinteger0Random seed (same seed, same output).
prefixstring or nullFrame file name prefix put before the effect name: <prefix>_<effect>_00.png ([A-Za-z0-9_.-], no '..'; default: none).
sheetstring or nullOptional sheet PNG path.
sheet_colsinteger12Contact 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.

ParameterTypeRequiredDefaultDescription
out_dirstringyesOutput directory (created if needed).
kindsstring 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').
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
stylestringGenerated kit style (omitted: bevel; not used with source). One of bevel, flat, rounded, scifi, pc98.
namestring"ui"Base file name ([A-Za-z0-9_.-]).
formatsstring 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.
sizestring or array of integer or nullOptional 'WxH' or [W, H] override for every requested kind, each side 1..1024 (not used with source). Exactly 2 items.
sourcestring or nullHand-edited piece PNG to re-export (requires margins; size and style must be omitted).
marginsstring or array of integer or object or null9-slice margins for source: 'L,T,R,B', [L, T, R, B] or {left, top, right, bottom} (non-negative integers). Exactly 4 items.
sheetstring or nullOptional labeled contact sheet PNG path.
godot_res_prefixstring or nullnullHow 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').
fontstring 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.
materialsobject or string or nullOverride the style's material ramps per slot (body, accent, bar): {'body': 'stone', 'accent': 'gold'} or 'body=stone,accent=gold' (material names: mode8.ramps.MATERIALS).
studsbooleanfalsebevel style: add the corner stud plates to dialogs and panels.
outline_blackbooleanfalseDraw the outer contour in #000000 (default: the palette's darkest color).
previewstring or nullAlso 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_scaleinteger3With 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.

ParameterTypeRequiredDefaultDescription
out_dirstringyesOutput directory (created if needed).
namestring"font"Base file name ([A-Za-z0-9_.-]).
colorstring"#ffffff"Glyph color '#rrggbb'.
outlinestring or nullOptional outline color '#rrggbb'.
shadowstring or nullOptional drop-shadow color '#rrggbb'.
scaleinteger1Integer scale 1..16; an integral number such as 2 or 2.0. Range: >= 1, <= 16.
formatsstring 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.
monobooleanfalseMonospaced: every glyph advances the same width (default: proportional).
charsetstring"latin1"Glyphs to export: 'latin1' (ASCII plus the Latin-1 letters and signs, 191 glyphs) or 'ascii' (95). One of latin1, ascii.
kernbooleantrueWrite 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).

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
namestringyesNew asset name (letters, digits, '_', '-', '.').
archetypestring or nullArchetype 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.
palettestring or nullPalette file path or bundled palette name (see mode8://palettes).
sizestring or array of integer or nullOptional 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_typestring or nullArt-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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset name (assets/<name>/).
image_pathstringyesRGBA PNG holding the new master.
expected_sha256string or nullSHA-256 of the master you edited.
opstring"agent_edit"Journal operation label.
respect_pinsbooleantrueKeep human-pinned pixels (pins.png) from the previous pixels.
on_layersstring"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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset name (assets/<name>/).
framestringyesFrame name (frames/<frame>.png).
image_pathstringyesEdited 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset name (assets/<name>/).
limitinteger20How 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset name (assets/<name>/).
image_pathstringyesRGBA PNG of the layer (canvas size).
layer_idstring or nullExisting layer id to replace; omit to add a new layer.
namestring or nullLayer display name (1-128 printable characters).
positionstring"top"New layers only: 'top', 'bottom', 'above:<id>' or 'below:<id>'.
visibleboolean or nullLayer visibility (hidden layers are not flattened).
opacityinteger or nullLayer opacity 0..255. Range: >= 0, <= 255.
expected_sha256string or nullSHA-256 of the master you edited.
expected_layer_sha256string or nullSHA-256 of the layer PNG you edited (from mode8_project_layers).
respect_pinsbooleantrueKeep 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.

ParameterTypeRequiredDefaultDescription
project_rootstringyesMode 8 project directory (contains mode8.toml).
assetstringyesAsset name (assets/<name>/).
actionstringyesLayer-stack operation. One of init, set, reorder, delete, duplicate, merge_down, flatten.
layer_idstring or nullTarget layer id (set, delete, duplicate, merge_down).
namestring or nullset: new layer name; init: base layer name (default Base).
visibleboolean or nullLayer visibility (hidden layers are not flattened).
opacityinteger or nullLayer opacity 0..255. Range: >= 0, <= 255.
orderstring or array of string or nullreorder: every layer id, bottom → top.
expected_sha256string or nullSHA-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).

ParameterTypeRequiredDefaultDescription
project_rootstringyesProject directory to create or complete.
templatestring or nullStarter template to scaffold (required unless refresh_godot). One of platformer, topdown, isometric, scifi.
namestring or nullProject name (default: the directory name).
forcebooleanfalseOverwrite existing template assets instead of skipping them.
refresh_godotbooleanfalseRe-export an existing starter's art into godot/ with this Mode 8 (actors, animated fixtures, props) and change nothing else.
assetsstring or array of string or nullWith 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#