Nodes/ComfyUI-SmartImageTools/Smart Image Preview Scaled
ComfyUI Node

Smart Image Preview Scaled

A preview that scales — and shows transparency honestly

By slvslvslv·Created about a year ago·Updated 24 days ago· 2
Smart Image Preview Scaled
  • images
    scale_by1.0
    transparencyoriginal

    You'd think previewing an image is the most solved problem in ComfyUI, and then you hit a cutout: the browser shows transparent areas as a black box or a checkerboard that's impossible to read, and small images render at a size where you can't see the edges anyway. Smart Image Preview Scaled is the pack's preview node that fixes both - it scales your image up (or down) and lets you composite transparency onto a background you choose.

    How it works

    Under the hood it's a subclass of ComfyUI's core PreviewImage node, so it behaves like the preview you already know - it's an output node, shows the image in the browser history, and carries workflow metadata. The two additions are what make it worth choosing:

    • scale_by - a magnification factor from 0.01 to 100. It resizes using nearest-neighbor interpolation, which keeps previews crisp and honest (no fake blur-smoothed pixels making you think the image is sharper than it is). This is huge when you're checking 512×512 generations that need to hold up at bigger sizes, or edge detail on a cutout.
    • transparency - how to show the alpha channel: original (raw RGBA, which ComfyUI may render against a dark background), or composite onto black, white, or orange. The orange is a deliberate choice - it's a common compositing backdrop for spotting edge issues because it's maximally different from both black and white subjects.

    It also reports the original image dimensions in its UI output, which is a small but genuinely handy detail for checking whether a node upstream quietly changed your resolution.

    Inputs and outputs

    • images - the IMAGE to preview.
    • scale_by - 0.01–100, default 1.
    • transparency - original / black / white / orange.

    Outputs: none. It's a display node - the end of a branch.

    Installing it

    From the ComfyUI-SmartImageTools pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/slvslvslv/ComfyUI-SmartImageTools
    pip install -r ComfyUI-SmartImageTools/requirements.txt
    

    Restart ComfyUI, or install via ComfyUI Manager ("SmartImageTools"). Uses OpenCV for the resize, so it needs the pack's standard install.

    When to swap it in

    Any time a core preview is working against you: checking cutout edges on a transparent background (use orange or white), inspecting a downscaled image up close (bump scale_by), or verifying a batch visually. It's not a replacement for a proper video preview on frame sequences - for video you want the pack's SmartVideoPreviewScaledMasked instead - but for stills it's the preview I'd keep on the graph.

    CategorySmartImageTools

    Inputs (3)

    NameTypeDefaultDescription
    imagesIMAGE
    scale_byFLOAT1.00.01–100
    transparencyCOMBOoriginal4 options: original, black, white, orange

    Outputs (0)

    No outputs