Nodes/Eric_Krea2/Eric Krea2 Save Latent (debug)
ComfyUI Node

Eric Krea2 Save Latent (debug)

Save the latent, not the pretty picture — when debugging needs receipts

By EricRollei·Created 2 months ago·Updated about a month ago· 11
Eric Krea2 Save Latent (debug)
  • latent
  • latent
pathA:\_dbg_latent.safetensors
auto_indextrue
label

Sometimes the image isn't the artifact - the latent is. When a multi-stage run produces a band across the bottom, or a splotch that only appears at 4k, you often can't diagnose it from the final PNG. Eric Krea2 Save Latent (debug) is the pack's tool for saving the packed KREA2_LATENT itself to a .safetensors file at any point in the graph, so you can compare, reload, and bisect what's actually wrong.

The name says debug and it's not underselling. This node sits wherever you need a snapshot - after Generate, between stages of a Multi-Stage Ultra run, after a Latent Resize - and writes the latent to disk while also passing it through. It's the "save game before the boss" of latent debugging, and the pack pairs it with Latent to ComfyUI LATENT for the full loop: save the packed latent, later unpack it and A/B the same latent through the pack's decode versus ComfyUI's native decode to find out whether a seam is a generation artifact or a decode artifact.

Inputs: latent (the packed KREA2_LATENT) and path - a base path, defaulting to A:\_dbg_latent.safetensors (again, Eric's drive - change it). The two optional inputs are what make it usable in batches:

  • auto_index (default ON) - never overwrite. The file written becomes <stem>_<NNNN>[_<label>]_<W>x<H>.safetensors, so a sweep or a sequence of runs accumulates numbered snapshots instead of clobbering each other. Turn it off to write exactly path.
  • label - a tag folded into the filename (banded, clean, with_lcm) so a pile of debug dumps stays identifiable.

One output: latent, a passthrough of the input, so you can drop this node inline without changing the graph's data flow. It's an output node, so it'll show as a sink in the UI.

Who actually uses this? The honest answer: people who've been burned by a hard-to-reproduce artifact. The README's own diagnostics - the bottom-edge band the DiT re-forms every denoise, tile-seam hunting, the crop_bottom band fix on the Ultra node - are exactly the failure modes where a saved latent lets you isolate "is it in the latent" from "is it the decode." If you've never debugged a latent, you can skip this node; if you have, you'll wonder why every pack doesn't ship one.

One caveat: these files are big - a 16-channel latent for a 2048² image is a real chunk of disk, and the packed format is the pack's own. Don't accumulate them forever; auto_index makes batches easy, and label makes cleanup easy.

How to install

Part of EricRollei/Krea2_ComfyUI_Advanced. ComfyUI Manager → search "Krea2_ComfyUI_Advanced", or:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Krea2_ComfyUI_Advanced

Restart. It needs the pack installed (the KREA2_LATENT type is pack-defined), but no extra models - the upstream generation nodes need the usual diffusers/weights setup.

Common issues

  • Files piling up - that's auto_index doing its job. It's a feature; clean the folder when the debug session's over.
  • "Path doesn't exist" - the default is a Windows path. Point path at a folder that exists on your machine.
  • Nothing saved - make sure this node is actually executed (it's an output node; if it's bypassed, no file).
CategoryEric/Krea2

Inputs (4)

NameTypeDefaultDescription
latentKREA2_LATENT
pathSTRINGA:\_dbg_latent.safetensorsBase path. With auto_index ON this is a prefix: the file written is <stem>_<NNNN>[_<label>]_<W>x<H>.safetensors next to it.
auto_indexoptBOOLEANtrueON: never overwrite - append an auto-incrementing 4-digit index (+ dims and label) so you can batch-save many. OFF: write exactly 'path'.
labeloptSTRINGOptional tag folded into the filename (e.g. 'banded', 'clean') to make batches easy to identify.

Outputs (1)

NameTypeDescription
latentKREA2_LATENT