Nodes/ComfyUI-Infinite-Canvas/画布图像输出 📤
ComfyUI Node

画布图像输出 📤

What this output node doesn't write

By zml-w·Created 10 months ago·Updated 9 months ago· 6
画布图像输出 📤
  • images

    CanvasImageOutput is this pack's final stop: an output node that takes the images it receives and writes them as PNG files into ComfyUI's output folder. In a normal workflow you'd feed it from a VAE Decode - or, in the pack's own Text-to-image example, straight off the decode on the way out of the sampler. It's the node the Infinite Canvas frontend watches to collect finished tiles, so the whole "keep outpaintng outward" loop ends here.

    How it works

    For every image in the incoming batch it multiplies by 255, clamps to a uint8 range, and saves with PIL as Canvas_Img_<n>.png. Because it's an output node, it also returns a UI entry so the result shows up in the ComfyUI preview panel and the frontend can grab it. Simple, and mostly fine - but there are two quirks worth knowing before you trust it with work you care about.

    Quirk one: the workflow doesn't ride along in the PNG

    In ComfyUI, the Save Image node stuffs the entire workflow graph into the PNG as text chunks. That's the community superpower - drag the image back onto the canvas and the whole pipeline rebuilds, seed included. This node saves with plain PIL and no pnginfo, so the files it writes are bare pixels. No embedded graph, no drag-to-rebuild.

    That's not an accident of the model, it's just a thin save. If you might want to reproduce a result later, export the workflow JSON yourself (Save → Export on the graph) before you close anything. In the frontend, the app's own state is your history - but the files on disk are dumb.

    Quirk two: the filenames are a counting accident

    The <n> isn't a per-node counter. It's len(os.listdir(output_dir)) - literally how many files are in the output folder at the moment of saving. So:

    • The number climbs as you generate, but it also counts every other file in that folder, not just this node's output.
    • Delete some files from the folder and the next save can reuse a name that already exists - and silently overwrite it.

    Worse, within a single batch the numbers only stay unique because the folder grows as each image saves. If you're saving something precious, rename or move it right after, and don't treat Canvas_Img_7.png as a stable name across runs.

    When to use it

    If you're in the Infinite Canvas ecosystem, this is the intended output - the frontend is watching for it. If you're not, stock SaveImage is strictly more capable: real workflow metadata, subfolder support, and predictable filenames. This one is a keep-it-simple exporter, and its simplicity has a cost.

    Install

    Same as the rest of the pack:

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

    Restart ComfyUI (or install via ComfyUI Manager → search "ComfyUI-Infinite-Canvas"), and add --enable-cors-header to your ComfyUI startup args if you plan to use the Infinite Canvas frontend - the README calls it out explicitly, and it's the most common "why won't my canvas talk to ComfyUI" failure. The node shows up under the 无限画布 category as 画布图像输出 📤.

    Category无限画布

    Inputs (1)

    NameTypeDefaultDescription
    imagesIMAGE

    Outputs (0)

    No outputs