Stepwise Latent Preview Grid
Turn saved step latents into that comparison grid, without any Python
- vae
- grid_image
If StepwiseKSampler is the node that saves per-step latents, this is the node that turns them into the picture. StepwiseLatentPreview takes a folder of saved .pt files, decodes the steps you ask for through a VAE, and stitches them into a single wide grid image - left to right, earliest step to latest. It's the visualization half of the analysis toolset in the AsymmetricQuantSampler pack, and it's what lets you actually see the paper's core claim with your own prompt instead of trusting the abstract.
The inputs are a short list: vae, save_dir (the string that StepwiseKSampler's save_dir output hands you - or paste the folder path), preview_steps (comma-separated, default 1,5,10,15,20), and use_x0 (default on). That use_x0 toggle is the one that matters. Each saved file contains both the raw noisy latent and the model's x0_prediction - its best guess at the finished image at that step. With use_x0 on, the node decodes the predictions, so you get a row of cleanly de-noising images and the grid looks like the pretty ones in the paper. Flip it off and you're decoding the actual noisy latents, which is messier but is the honest "what the sampler was holding" view. Leave it on unless you're debugging something specific.
Output is a single grid_image (an IMAGE, tiles concatenated along the width), so wire it straight into PreviewImage or SaveImage. Missing files for a requested step are silently skipped, and if nothing valid is found it throws an error rather than returning a blank. The one real gotcha: save_dir is just a string, and the grid can only show steps that were actually saved - ask for step 7 when you only saved 1,5,10,15,20 and you'll get a four-tile grid, no complaint. So either match preview_steps to what you saved in StepwiseKSampler, or (easier) keep save_steps at "all" and let the preview pick what to show. Grids get wide fast - five 1024px tiles is a 5120px image - so SaveImage rather than on-screen preview if you want to actually compare.
Install is the same shared pack install: ComfyUI Manager, search "Asymmetric Quantization Sampler", or:
cd ComfyUI/custom_nodes/
git clone https://github.com/lee09lee26/ComfyUI-AsymQuantSampler.git
Restart ComfyUI and it's there. No pip dependencies - ComfyUI built-ins only. This is a thin, single-purpose utility, and it's fine that it's thin: in a workflow it sits after StepwiseKSampler, and the two of them replace a chunk of "dump tensors, write a decode script, fight with matplotlib" that you'd otherwise be doing by hand. For the price of adding one pack, that's a fair deal.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | — | |
| save_dir | STRING | — | |
| preview_steps | STRING | 1,5,10,15,20 | — |
| use_x0 | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| grid_image | IMAGE | — |