Nodes/ComfyUI Preview Magnifier/Preview Image Magnifier
ComfyUI Node

Preview Image Magnifier

A magnifying glass that lives on the node

By ycchanau·Created 2 years ago·Updated 2 years ago· 2
Preview Image Magnifier
  • image

    You know the loop. You generate an image, you spot something off about the hands, and suddenly you're zooming the whole canvas in and out or saving the PNG just to open it in another app and squint at it. YC.PreviewImageMagnifier exists to kill that loop: it draws your image right on the node and gives you a hover lens that magnifies whatever's under the cursor. No saving, no switching windows, no dragging the canvas around.

    It's the single-image node from ComfyUI Preview Magnifier (by ycchanau), a tiny MIT-licensed pack. And "tiny" is doing a lot of work: there's no requirements.txt, no model downloads, nothing to configure. The README is literally one line - "For learning purpose" - plus a screenshot. The real documentation is the source, which is mercifully short.

    How it works

    Under the hood this is just ComfyUI's built-in PreviewImage node with a frontend upgrade. The Python half subclasses PreviewImage, calls the same save_images() the stock node uses, and hands the saved filenames back to the frontend. The clever part lives in web/image_magnifier.js: it renders the image as an inline <img> on the node canvas, then on every mousemove shows a rounded lens - a window about a third of the image's edge, blown up 3x - that follows your cursor. It's pure frontend math (CSS background-position), so the node itself does zero image processing and adds no inference overhead.

    Because it's a PreviewImage subclass, it does two things at once: it previews and it writes a PNG to ComfyUI/output with a YC.PreviewImageMagnifier. prefix. That catches people out if they're not expecting it.

    The inputs and outputs

    Everything you'll ever touch is one input:

    • image (IMAGE) - wire your latent-decoded image (or any IMAGE tensor) in here.

    That's the whole thing. There are no outputs - this is a terminal display node. Nothing wires out of it, which is the thing beginners trip on: you don't connect anything after it, it is the end of the branch. It shows up in the node menu if you search "magnifier" or the YC. prefix.

    Installing it

    Either route works:

    • ComfyUI Manager - search for "ComfyUI Preview Magnifier" and install, then restart.
    • Manual -
    cd ComfyUI/custom_nodes
    git clone https://github.com/ycchanau/ComfyUI_Preview_Magnifier
    

    then restart ComfyUI. No pip installs, no models to fetch - it's dependency-free, which is refreshing in an ecosystem where node packs routinely drag in half of PyPI.

    Things to know

    The widget is rendered by a JavaScript extension, so if you've just updated the pack and the image area looks wrong, do a hard browser refresh (Ctrl+Shift+R) - cached extension files are a classic ComfyUI gremlin. And keep an eye on your output folder: this node saves a file on every run, so a long batch session fills it up like any other preview node.

    Honest take: for a single image, you can just zoom the canvas in ComfyUI. This node is a nice-to-have on its own. The pack's other two nodes - the grid magnifier and the side-by-side comparer - are where the value actually lives. But if you're already installing those, this one comes free, and it's handy when you're iterating on a prompt and want to check detail without losing your canvas framing.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageIMAGE

    Outputs (0)

    No outputs