Nodes/ComfyUI SaveImage SDLI/Preview SDLI Image
ComfyUI Node

Preview SDLI Image

A Fast Look That Keeps the Latents

By MitoshiroPJ·Created about a year ago·Updated about a year ago· 1
Preview SDLI Image
  • samples
  • vae
    latent_typeSDXL
    reduction_ratio1/1
    quality80
    positive_prompt
    negative_prompt

    The name undersells it. Preview SDLI Image isn't just "show me what this looks like" - it writes a full SDLI file into ComfyUI's temp folder, so the .webp you grab from the browser is simultaneously a preview and a container holding the exact latents that made it. If the iteration turns out to be a keeper, you haven't lost the state; you've parked it somewhere you can pick it back up.

    Preview vs. Save

    This is the same code as its sibling, Save SDLI Image - PreviewSdlImage is literally a subclass of it in the source. The difference is intent and destination. Preview writes to ComfyUI's temp directory with a random _temp_ filename prefix, skips the filename_prefix input entirely, and marks its files as temp in the UI. It's the "quick look during the iteration loop" node; use Save for anything you actually want to archive in output/.

    What's in the file

    An SDLI .webp is a RIFF container: the decoded preview image as a normal WebP chunk, plus an SDLI chunk holding the latents serialized as safetensors. You can double-click the file and it opens in any image viewer - but the payload is the latent tensor, stored lossless (as fp16) so it can be loaded back for further sampling, a different sampler pass, or an upscale-then-rediffuse run without the lossy VAE decode→encode round trip that the normal Save Image workflow forces.

    Inputs

    PreviewSdlImage shares almost everything with Save:

    • samples (required) - the LATENT from your KSampler. It's the whole point: this format carries latents, not pixels.
    • latent_type - SD1, SDXL, SD3, or FLUX.1. Selects the TAESD fallback and tags the file metadata.
    • reduction_ratio - 1/1 to 1/8. Shrinks only the preview image, not the latents. Use 1/4 or 1/8 for a tiny embeddable thumbnail that still carries full-res latents.
    • quality - WebP compression quality for the preview, default 80.
    • vae (optional) - your real VAE for an accurate preview. Leave it empty and the node auto-loads the matching TAESD tiny VAE from models/vae_approx, which is fast but noticeably softer.
    • positive_prompt / negative_prompt (optional) - stored as metadata. If positive is empty, the node grabs the text from the first CLIPTextEncode in your graph automatically.

    No outputs - it's a terminal node, so the generated WebP shows in the preview pane where you can download it via the browser.

    Installing

    ComfyUI Manager (search "ComfyUI SaveImage SDLI"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MitoshiroPJ/ComfyUI_save_image_sdli
    

    Restart ComfyUI. Zero extra pip dependencies - it only uses torch, safetensors, PIL, and numpy, all bundled with ComfyUI. The one optional download is the TAESD family if you plan to preview without wiring a VAE.

    Gotchas

    • TAESD model missing = error on first run. If vae is empty, ComfyUI's built-in TAESD loader reads models/vae_approx and needs taesd_encoder/taesd_decoder (or taesdxl_*, taesd3_*, taef1_*) files from madebyollin's taesd releases. Drop them into ComfyUI/models/vae_approx and the fallback stops failing.
    • The preview is a lossy thumbnail, not the product. Especially with the TAESD fallback - judge composition, not sharpness, and don't be surprised the WebP looks softer than the final image.
    • Temp files are temporary. They live in the temp directory and get swept on restart. If a preview turns out to be the one, that's what Save SDLI Image is for.

    It's a niche pack with a narrow job, but if you live in the iterate-forever loop, Preview + Save as a pair genuinely change how often you re-roll a good seed.

    Categoryimage

    Inputs (7)

    NameTypeDefaultDescription
    samplesLATENTThe latent to be decoded.
    latent_typeCOMBOSDXL4 options: SD1, SDXL, SD3, FLUX.1
    reduction_ratioCOMBO1/14 options: 1/1, 1/2, 1/4, 1/8
    qualityINT80
    vaeoptVAEThe VAE model used for decoding the latent.
    positive_promptoptSTRING
    negative_promptoptSTRING

    Outputs (0)

    No outputs