Nodes/ComfyUI-Infinite-Canvas/画布图像输入 🖼️
ComfyUI Node

画布图像输入 🖼️

A Load Image that only half bothers with the mask

By zml-w·Created 10 months ago·Updated 9 months ago· 6
画布图像输入 🖼️
    • IMAGE
    • MASK
    image

    CanvasImageInput is the door image files walk through in this pack. You pick a picture from ComfyUI's input folder (or upload one), and the node turns it into a IMAGE tensor the graph can actually use - for img2img, for a ControlNet reference, for feeding an outpainting pass on the Infinite Canvas. It looks a lot like the built-in LoadImage node, and there's a reason: it basically is one, with one difference that'll bite you.

    How it works

    The node lists every file in ComfyUI/input and gives you an image dropdown with an upload button. On load it opens the file, converts to RGB, divides by 255 to get floats in the 0–1 range, and adds a batch dimension. What comes out is a [1, H, W, 3] tensor - standard ComfyUI IMAGE - ready to plug into anything image-shaped.

    That's the honest mechanism, and for the IMAGE output it's exactly right.

    The mask, and why you shouldn't trust it

    Here's the difference from stock LoadImage. LoadImage gives you a real MASK derived from your image's alpha channel - the thing you wire into inpaint and edit workflows when you want to protect or regenerate specific areas. This node's MASK output is a placeholder: a 64×64 all-zero tensor, no matter how big your image is.

    An all-zero mask means "mask nothing" in ComfyUI's convention, so wiring this MASK into an inpainting node silently does nothing while you assume it's protecting something. It exists so the socket is there - the author shipped a shape without a purpose. Don't build a masking pipeline on it. If masking matters, use LoadImage, or load the image here and generate your real mask elsewhere (there are plenty of proper masking packs).

    What you actually wire

    • IMAGE - the star. Goes to VAE Encode for img2img, to ControlNet, or into the pack's own CanvasResolutionSelector to size it for the canvas.
    • MASK - exists, ignore it.

    One behavior to note: the RGB conversion in load() flattens transparency, so a PNG with alpha comes in as an opaque image. That's also why the mask is fake - there's no alpha channel left to derive one from.

    Install

    Standard custom node install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-Infinite-Canvas
    

    Restart ComfyUI, or use ComfyUI Manager (search "ComfyUI-Infinite-Canvas") and let it pull opencv-python and imageio-ffmpeg for you. The pack's README is adamant about one more thing: add --enable-cors-header to ComfyUI's startup arguments, because this is the backend for the Infinite Canvas frontend app. The nodes work without the flag in the stock UI, but the frontend won't.

    Troubleshooting

    The classic trap is the dropdown itself: it's built from the input folder at the moment the node is created, so drop a new file in and the list doesn't update until you refresh or re-add the node. And remember the file has to be in ComfyUI/input - pasting a path from anywhere else won't work. If you're not running the Infinite Canvas frontend at all, be honest with yourself: stock LoadImage is strictly better here (real mask, subfolder support, proper preview). Use this node because you're in the pack's ecosystem, not because it's an upgrade.

    In the node list, it lives under the 无限画布 category, displayed as 画布图像输入 🖼️ - the Chinese name is the same node.

    Category无限画布

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK