Nodes/Image Misc/Create Empty Image
ComfyUI Node

Create Empty Image

A blank canvas that inherits another image's exact shape

By set-soft·Created about a year ago·Updated 8 months ago· 2
Create Empty Image
  • reference
  • image
width1024
height1024
batch_size1
color#000000

Sometimes the most useful node is the one that just makes a flat rectangle. Create Empty Image fills a tensor with one solid color at a chosen size and batch count - think of it as core ComfyUI's EmptyImage, but with two upgrades that actually earn it a place in a workflow.

The first is the color input. Instead of a single fixed value, it accepts a hex string like #AABBCC, comma-separated RGB values in the 0–255 range (255,0,128), or normalized floats in 0.0–1.0 (1.0,0.0,0.5). If you've ever wrestled with a node that only takes one of those formats, you'll appreciate it. The second is the reference input, and it's the reason most people reach for this node at all.

The reference input is the whole trick

Plug any image into reference and its batch size, height and width silently override the manual width, height and batch_size fields. That means you can make a solid-color image that exactly matches whatever upstream node produced - a mask, a VAE decode, a ControlNet preprocessor output - without reading dimensions off the UI and retyping them. In compositing and inpainting setups where every node needs to agree on canvas size, that one wire saves you a class of "size mismatch" errors before they happen.

Internally it's satisfyingly cheap: the node builds a tiny 1×1×1×3 color tensor and expands it into a view, so a "1024×1024 image" never materializes a full buffer at creation time. It also stays on CPU by default, which is the right call for a generator node.

The inputs that matter

  • width / height - target dimensions, ignored when reference is connected.
  • batch_size - how many identical images to make, up to 64.
  • color - the fill color, in any of the three formats above.
  • reference (optional) - the image whose shape you want to clone.

Output is a single image tensor, ready to feed a VAE encode, an ImageComposite, or anything that needs a placeholder while you build the rest of the graph.

Installing it

This node ships in the Image Misc pack by set-soft (Salvador E. Tropea). Via ComfyUI Manager, search "Image Misc" and install, or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-ImageMisc
cd ComfyUI-ImageMisc && pip install -r requirements.txt

Then restart ComfyUI. The only real dependency beyond what ComfyUI already ships is seconohe, the author's shared helper library, which itself only depends on ComfyUI - so there's no model to download and nothing heavy to compile.

Where it bites

The color parser is strict about hex - include the #. And remember the reference image overrides everything, including batch_size: if your reference is a batch of 4, you get 4 blank images whether you asked for 1 or not. That's usually exactly what you want, but it surprises people the first time. The node appears under image/generation in the Add Node menu, and there are example workflows bundled with the pack if you want to see it wired up.

Categoryimage/generation

Inputs (5)

NameTypeDefaultDescription
widthINT10241–8192The width of the new image in pixels. This value is ignored if a `reference` is provided.
heightINT10241–8192The height of the new image in pixels. This value is ignored if a `reference` is provided.
batch_sizeINT11–64The number of images to create in the batch. This value is ignored if a `reference` is provided.
colorSTRING#000000Color for fill. Can be an hexadecimal (#RRGGBB). Can comma separated RGB values in [0-255] or [0-1.0] range.
referenceoptIMAGEIf an image is connected here, its dimensions (batch size, height, and width) will be used for the new image, overriding the manual width, height, and batch_size inputs.

Outputs (1)

NameTypeDescription
imageIMAGE