Nodes/h4_Live/h4 - Smart Save
ComfyUI Node

h4 - Smart Save

The save node that keeps a whole forensic file next to every PNG

By m3rr·Created 9 months ago·Updated 10 days ago· 1
h4 - Smart Save
  • images
  • IMAGE
filename_prefixh4_
save_modefalse
queue_memoryfalse
output_path
metadata_modeLite (Author+Model)
json_modeFull (Forensic)
authorh4
commentsh4 - [ Approved ] - (b'.')b
custom_json
model_nameAwesome Model of Awesomeness

Stock ComfyUI's Save Image writes the workflow into the PNG's text chunks and calls it a day. H4_SmartSave - the flagship of the h4_Live pack, the one the author has bumped to "STABLE" - does something more forensic: it traces the actual graph that produced the image, writes a readable metadata record to a .json sidecar sitting right next to the PNG, and gives you a proper preview before you commit anything to disk. If you've ever had to dig through a workflow chunk with a text editor to remember which LoRA and seed made that image, this is aimed at you.

It's also the node with the pack's most honest known wart, which the README admits openly: preview thumbnails and history can load slowly. More on that below.

How it works

The interesting part is the "DNA extraction." When you run the graph, SmartSave hands the full execution prompt to the pack's session manager, which walks backward through your node graph - tracing the model chain, any LoRAs and their strengths, the VAE, the CLIP, the sampler settings - and builds a structured record. That record, plus whatever you set in the metadata fields, gets written two ways:

  1. A .json sidecar saved alongside the PNG (h4_0001.png + h4_0001.json). This is the actual mechanism - unlike stock Save Image, the PNG itself is written with its metadata chunks empty. The recipe lives in the sidecar file, where you can read it without a PNG inspector.
  2. A session manifest in a local SQLite database, so the node's history rail has something to list.

There's also a smart counter: it scans the output folder and picks up numbering where you left off, so a re-run won't silently overwrite an earlier h4_0001.png. That's the "generational overwrites" fix in the changelog.

The inputs that matter

  • images (IMAGE) - required, your output.
  • save_mode (boolean, default OFF) - the big one. OFF means Preview Only: images go to a temp previews folder and nothing pollutes your output directory. Flip it ON to Save to Disk. You'd be surprised how many people click Queue and wonder where their PNG went - it's preview mode.
  • filename_prefix (string, default h4_) - base name; the counter appends _0001, _0002...
  • metadata_mode (enum) - how much of the identity block goes into the sidecar: None, Clean (Author), Lite (Author+Model), Lite+ (+Prompt), Full (Forensic), Custom. Full is the whole story including comments.
  • json_mode (enum) - same ladder, but for the JSON sidecar payload.
  • author, model_name, comments, custom_json - the fields those modes fill in.
  • output_path (string) - optionally push saves to a custom directory.

Outputs: IMAGE - the same images that went in, so you can chain further nodes after saving.

Installing h4_Live

Part of the h4_Live pack. ComfyUI Manager: search h4_Live, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/m3rr/h4_Live

Restart. No model files, no pip extras. But note this is a one-developer pack still under active development - "STABLE" here means "the author hardened it in v10", not "three years of battle testing", and the community footprint for the pack is basically nonexistent so far (try searching Reddit; you'll find nothing). Treat it as promising but unproven.

Common issues

  • The lag is real and acknowledged. Thumbnail and initial-preview loads can be slow, and large history states cause UI lag while the metadata parsing runs. The author says it's being worked on. If the UI freezes, it's usually this, not your GPU.
  • Don't drag these PNGs back to rebuild your workflow. Because the PNG is saved with empty metadata chunks and the info lives in the sidecar, the standard "drag the image onto the canvas to recover the graph" trick doesn't work here - a real break from stock behavior. If that matters, keep the .json sidecar, or use stock Save Image alongside.
  • CDE degradations. On ComfyUI Desktop Edition, the fancy panel system (docked / pinned / popout drawers, the lightbox with arrow-key navigation) can be disabled by the sandboxed renderer. Works, just less chrome.
  • Wiring for loops. This node plays well with the h4 traffic/loop nodes (it's an output node, so it always runs), but remember it shares the pack's single global loop counter with everything else.
Categoryh4/IO

Inputs (11)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixoptSTRINGh4_
save_modeoptBOOLEANfalse
queue_memoryoptBOOLEANfalse
output_pathoptSTRING
metadata_modeoptCOMBOLite (Author+Model)6 options: None, Clean (Author), Lite (Author+Model), Lite+ (+Prompt), Full (Forensic), Custom
json_modeoptCOMBOFull (Forensic)6 options: None, Clean (Author), Lite (Author+Model), Lite+ (+Prompt), Full (Forensic), Custom
authoroptSTRINGh4
commentsoptSTRINGh4 - [ Approved ] - (b'.')b
custom_jsonoptSTRING
model_nameoptSTRINGAwesome Model of Awesomeness

Outputs (1)

NameTypeDescription
IMAGEIMAGE