Badge Edit State Save (DAELab)
A resumable save file for a workflow that costs money per run
- current_master
- normalized_flat_image
- current_foreground_mask
- current_height
- state_path
- report
What it is and why you'd reach for it
A PNG is not a save state. Your badge pipeline's real state is five things: the current master render, the normalized flat design, the six-level height map, the foreground topology, and the registration transform that ties design coordinates to render coordinates. Lose any of them and you can't do another local edit - you have to re-run the generative stages, which on this pack means paying for GPT-Image-2 calls again.
Badge Edit State Save zips all of it into one file with a .badge_state extension and writes it into ComfyUI's output directory. It also sweeps up the colour-group configuration from the Multi Color Mask nodes in the workflow, so a resume doesn't lose which source colour mapped to which height layer. Wire state_path straight into Badge Edit State Load and the pair behaves like a portable snapshot of where you got to.
How it works
The inputs are converted to floats in the documented ranges and dumped as .npy entries inside a deflated zip:
metadata.json
current_master.npy
normalized_flat_image.npy
current_foreground_mask.npy
current_height.npy # only when you supply current_height
metadata.json is version: 1 plus height_enabled, registration_info, current_prompt, and a color_group_configs array. That array isn't an input - the node reads the workflow that's being executed and lifts the saved properties off any DAELabMultiColorMask / DAELabMultiColorMaskV1 nodes it finds. Clever, and it's why your colour groups survive a reload without you retyping hex codes.
The filename handling is worth knowing about: filename_prefix defaults to Badge_8_2/state and works like SaveImage's prefix - slashes make subfolders under ComfyUI/output/. The node sanitizes path parts, strips ./.., and appends a YYYYMMDD_HHMMSS timestamp and the .badge_state extension. So you get output/Badge_8_2/state_20261024_140233.badge_state rather than an overwriting state.badge_state. That's the right call for iteration, and mildly annoying if you wanted a single "current" file.
The parameter that will confuse you is enabled. It defaults to false, and when it's false the node writes nothing and returns an empty state_path plus State save disabled; no file written. That's deliberate - it stops a save node from littering output on every test run - but if you queue a workflow and wonder where the file went, this is why.
Inputs and outputs that matter
Required: current_master, normalized_flat_image, current_foreground_mask, height_enabled, registration_info (paste the registration node's transform string), current_prompt, enabled, filename_prefix. Optional: current_height - and if height_enabled is true without it, the node raises rather than writing a half state.
Outputs: state_path (the absolute path, wire it onward) and report. This is an output node, so it always executes - the cache works backwards from it.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library
Restart. The badge module imports OpenCV, which the pack's requirements.txt does not declare, so if the node doesn't show up: pip install opencv-python-headless. Note also that states are written relative to ComfyUI's configured output directory, not the pack folder - back that directory up separately if these snapshots matter.
Common issues
- Nothing was written.
enabledwas false, or yourstate_pathoutput is empty because of it. Check thereportstring. height_enabled is true, so current_height must be saved.Either wire the height map or turnheight_enabledoff before saving. The load node uses that flag to decide whether downstream height stages are live.- Colour groups missing after reload. The node only captures configs from Multi Color Mask nodes present in the workflow at save time and serialized into it. Nodes you deleted, or ones bypassed in a way that drops their properties, won't be in the snapshot.
- The path changes every run. Timestamps. If you want a stable target, copy the newest
.badge_stateto a fixed name and point the load node at that.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| current_master | IMAGE | — | |
| normalized_flat_image | IMAGE | — | |
| current_foreground_mask | MASK | — | |
| height_enabled | BOOLEAN | true | — |
| registration_info | STRING | — | |
| current_prompt | STRING | — | |
| enabled | BOOLEAN | false | — |
| filename_prefix | STRING | Badge_8_2/state | — |
| current_heightopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| state_path | STRING | — |
| report | STRING | — |