Nodes/ComfyUI Preview Magnifier/XY Preview Image Magnifier
ComfyUI Node

XY Preview Image Magnifier

Zoom into any cell without losing your place

By ycchanau·Created 2 years ago·Updated 2 years ago· 2
XY Preview Image Magnifier
  • images
    img_per_row1

    Some workflows hand you a wall of near-identical images: a sampler batch, a denoise sweep, a grid of seeds. ComfyUI's built-in preview shows you one frame at a time, and the alternative - dumping a whole grid and hoping the browser lets you zoom in - means losing your place in the batch. YC.XYPreviewImageMagnifier lays the whole batch out as a grid on the node, and every single cell gets its own hover magnifier. Inspect the details of frame 37 without ever losing track of where 37 sits in the row.

    It's the grid node from the same tiny MIT-licensed pack as Preview Image Magnifier (ycchanau's ComfyUI Preview Magnifier). Same DNA: no dependencies, no models, nothing to configure. The README is a one-liner, so the source is the real documentation - and it's small enough that reading it is actually feasible.

    How it works

    Mechanically it's the same trick as the single-image node: the Python class subclasses ComfyUI's built-in PreviewImage and saves the frames, while the frontend in web/image_magnifier.js does all the interesting work. You feed it a batched IMAGE tensor - that's a B,H,W,C tensor where each frame in the batch is one image, the kind of thing a sampler with batch size > 1 or an XY-plot/script-built grid produces. The backend saves every frame as its own PNG to ComfyUI/output (with a YC.PreviewImageMagnifier. prefix, same as the single-image node - so files from both land in one numbered series). The frontend then splits the frames into a grid, gives each cell its own magnifier, and auto-sizes the node to match the grid's aspect ratio.

    The inputs that matter

    Just two:

    • images (IMAGE) - your batch. This has to actually be a batch; a single 1-frame tensor renders as a one-cell grid.
    • img_per_row (INT, default 1, min 1, max 10) - how many cells per row. Bump it to 2-4 for a sweep and the grid reflows live. Note this only changes the on-screen layout; it has zero effect on what gets saved.

    No outputs, as with all the nodes in this pack - it's a terminal display node, so nothing wires out of it. Search "XY" or "magnifier" in the node menu to find it.

    Installing it

    Same as the rest of the pack. ComfyUI Manager, search "ComfyUI Preview Magnifier," install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ycchanau/ComfyUI_Preview_Magnifier
    

    restart, done. No pip dependencies, no model files, no config.

    Things to know

    The most common "it's broken" report for this one is really a batch-dimension problem: if you've wired in a single image (or an output whose batch got collapsed to 1), you'll see one lonely cell. Check what's producing your IMAGE tensor - if it's a sampler set to batch size 1, that's why. Anything that concatenates or stacks frames into one tensor works.

    Worth knowing: the frontend grid is rebuilt from scratch on every execution, so a long batch can take a moment to lay out. And since every frame is written to disk as its own file, a 100-frame sweep is 100 PNGs in your output folder - expected behavior, not a bug. Also, like the rest of the pack, a hard browser refresh after updating is the fix if the widget misbehaves.

    It's a genuinely useful variant if you do sweeps - nothing else in stock ComfyUI lets you inspect grid cells at 3x without losing your place.

    Categoryimage

    Inputs (2)

    NameTypeDefaultDescription
    imagesIMAGE
    img_per_rowINT11–10

    Outputs (0)

    No outputs