Nodes/KMCDev Nodes/Image Blank with Alpha
ComfyUI Node

Image Blank with Alpha

A solid-color canvas with an alpha channel — and a sneaky multiple-of-8 gotcha

By kevinmcmahondev·Created 2 years ago·Updated 2 years ago· 0
Image Blank with Alpha
    • IMAGE
    width512
    height512
    red255
    green255
    blue255
    alpha255

    The node that makes a blank image sounds too trivial to write an article about, right up until you're building a compositing workflow and realize core ComfyUI doesn't hand you a plain canvas to paint onto. Image Blank with Alpha makes a solid-color image of whatever size and RGBA color you ask for. That's it. It's one of those utility nodes that costs nothing to have around and saves you from bolting together a hacky chain every time you need a flat background.

    Set width and height (8–4096, default 512), then the red / green / blue channels (0–255, default 255 = white) and alpha (0–255, default 255 = fully opaque). The output is a standard IMAGE tensor, ready to feed anything. Defaults give you an opaque white 512×512, which is the boring-but-useful case.

    How it works. Under the hood it builds a Pillow image in RGBA mode and converts it to a ComfyUI tensor. The important detail is that RGBA part: this is one of the few blank-canvas nodes that carries a real alpha channel, so if you composite things onto it, transparency survives. Set alpha to 0 and you get a fully transparent canvas - that's how you assemble a PNG with a see-through background from pieces, which most of the standard blank-image nodes don't do cleanly.

    The gotcha that will bite you: the node silently snaps your dimensions down to the nearest multiple of 8. Ask for 513×513 and you get 512×512. It's deliberate - SD latents tile in 8×8 blocks - but it's invisible from the UI, and it'll come back to haunt you when a downstream node complains about a size mismatch or your output isn't quite the resolution you planned. Size your canvas in multiples of 8 from the start and check the output dims if something seems off.

    Where you'd reach for it: a background matte to composite an inpaint result or a subject onto; a known solid color to test downstream nodes against; a fixed-size empty frame to seed an animation or video batch; or a colored layer under a mask to see exactly what your mask covers. It's the boring glue of masking workflows, and boring glue is fine.

    Install is the same as the rest of this pack: ComfyUI Manager → search "KMCDev" → Install, then restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kevinmcmahondev/comfyui-kmcdev-image-filter-adjustments
    

    then restart ComfyUI. No models, no heavy dependencies - the pack only needs numpy, Pillow and torch, which ComfyUI already has.

    Troubleshooting. If your canvas comes out smaller than you typed, it's the multiple-of-8 snap, not a bug. If a downstream node chokes on the fourth channel, not every node expects RGBA - route the image through an RGB conversion first, or keep alpha at 255 and let nodes that drop it do their thing. And if you set alpha to 0 and "see nothing," that's not broken either - you've made a transparent image, so preview against a checkerboard or composite something onto it.

    CategoryKMC DEV/Image

    Inputs (6)

    NameTypeDefaultDescription
    widthINT5128–4096
    heightINT5128–4096
    redINT2550–255
    greenINT2550–255
    blueINT2550–255
    alphaINT2550–255

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE