Nodes/comfyui-ap-tools/AP Image Preview
ComfyUI Node

AP Image Preview

The preview node with a loupe, for when 'close enough' isn't

By Snoopick·Created 5 months ago·Updated 4 months ago· 0
AP Image Preview
  • image

    ComfyUI's built-in Preview Image is fine until it isn't - squint at a batch of four variants, and you're either scrolling or zooming the whole canvas. AP Image Preview is the "I've been burned by this" upgrade. It's a display-only node that shows your image (or whole batch) in a grid, gives you a magnifying loupe that follows the mouse at 1.5x–8x zoom, and lets you flip through batch frames with arrow buttons. No outputs, no saving, no side effects - just a better window onto what your graph just made.

    It's the kind of node you reach for mid-iteration, not at the end. When you're dialing in a LoRA weight or testing four samplers in one batch, the grid mode shows every variant at once and the loupe lets you check an eye or a hand without blowing up the graph or opening files in another program. Because it hides the standard ComfyUI output thumbnail, your output sidebar stays clean too - the comparison habit most people build with an external tool (see the ecosystem doc's notes on rgthree's comparer for the same philosophy applied to side-by-side) starts right here.

    How it works

    The Python side is short and honest: for every image in the input batch it converts the tensor to a PIL image and saves it to ComfyUI's temp folder as preview_<timestamp>_<i>.png, then returns the file list through the ui dict. The frontend JavaScript does the rest - it renders those temp files into a custom DOM widget with a canvas, draws the single/grid view, and runs the loupe. Because it's an output node it always executes, which is what makes it useful as a "look at this" checkpoint mid-pipeline.

    Inputs and outputs

    One input, no outputs:

    • image (IMAGE) - a single image or a batch. That's it. It's display-only; is_output_node is true, so it always runs but produces nothing downstream.

    Since it doesn't save anywhere permanent, remember to pair it with a SaveImage node if you actually want the file - the preview PNGs are temp files, and ComfyUI cleans its temp directory. The minimum node size is 420×460 and it auto-fits the image to the widget, so it won't sprawl across your canvas.

    Common gotchas

    • The previews are transient. They land in the temp folder (temp/preview_*.png). Don't go hunting for them later; they're there for the widget, not for you.
    • IMAGE only. It takes a plain image tensor, not a mask, not a latent. If you want to inspect masks you'll want a dedicated mask preview node.
    • The loupe is per-node. It's a widget in that node's box, not a global magnifier - you inspect where the node is.

    Install

    Via ComfyUI Manager (search "ap-tools"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Snoopick/comfyui-ap-tools
    

    Restart ComfyUI and the node appears under ap-tools. No model downloads, no Python dependencies beyond stock ComfyUI - the whole thing is vanilla JS plus a few lines of image saving.

    Is it worth it? If you live in batch workflows and find yourself zooming the canvas constantly, yes - it's one of those utility nodes you install, grumble about not having found sooner, and then forget is installed because it just quietly does its job.

    Categoryap-tools

    Inputs (1)

    NameTypeDefaultDescription
    imageIMAGE

    Outputs (0)

    No outputs