Empty Unit Generator (UTK)
A blank canvas, mask, and latent in one node — for testing and layout
- image
- mask
- latent
- width
- height
- batch_num
Sometimes you need a placeholder image - a blank canvas to test a composite, a mask to check your pipeline against, or an empty latent to measure a sampler without doing real work. Empty Unit Generator (UTK) produces all three at once: a solid-color image, a matching mask, and an empty latent, sized to a resolution you pick. It's the "blank unit" node that's genuinely useful for layout work and for debugging workflows in isolation.
The inputs
- width / height (default 1024) - the base canvas size.
- ratio - a big preset list of common resolutions (SD1.5 and SDXL presets, from 512×512 up to SDXL's 1536×640 widescreen) or
customto use width/height directly. If you pick a preset, it wins over the numeric width/height. - scale (default 1.0) - multiplies the final dimensions, so 0.5 on a 1024 canvas gives you 512.
- divisor (default 8) - snaps the result to a multiple of this. 8 is the VAE/latent-friendly default; 16 or 32 for stricter pipelines.
- image_color - white, black, or gray. That's the palette for the blank image; no custom hex here.
- batch (default 1) - how many blank units to produce.
- latent_type -
standard,sd3, orhunyuan(the source also supportsltx). This matters: different architectures want differently-shaped empty latents, and picking the wrong one is a classic "latent shape mismatch" error. Match it to the model you're about to test.
Outputs
Six: image, mask, latent, plus width, height, and batch_num so you can feed the numbers into other nodes without hardcoding them. The mask is a full white rectangle matching the image - handy when a workflow needs "something to mask with" while you're still building it.
Where it fits
- Testing a pipeline with no real input - wire this in, run, confirm the graph works, then swap in real images.
- Building composite/layout graphs before the actual assets exist.
- Sanity-checking a sampler or latent round-trip without generating from a checkpoint.
It's a scaffolding node, not a showpiece. You won't use it in finished workflows, but you'll be glad it exists while you're building one.
Installing it
Standard pack install - ComfyUI Manager → search ComfyUI-UniversalToolkit, or:
cd ComfyUI/custom_nodes
git clone https://github.com/whmc76/ComfyUI-UniversalToolkit
cd ComfyUI-UniversalToolkit && pip install -r requirements.txt
Then restart. OpenCV/PIL/numpy - pack basics, nothing exotic.
Gotchas
- Preset ratio overrides width/height. If you set width 512 but leave ratio on an SDXL preset, you get the preset's dimensions and wonder why your numbers were ignored. Set ratio to
customto drive everything by numbers. - latent_type must match your model. Test with standard first; only use sd3/hunyuan/ltx if you're targeting those architectures. The wrong choice produces empty latents that fail at the sampler.
- The mask is full-white, not empty. If you expected a blank mask for "nothing to mask," flip it - a full white mask covers everything. For an empty mask you'd generate one and invert.
It's the kind of node you forget until you need a quick canvas - then it saves you from hand-rolling a blank image in an editor just to test a wire.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464–4096 | — |
| height | INT | 102464–4096 | — |
| ratio | COMBO | SDXL - 1:1 square 1024x1024 | 18 options: custom, SD1.5 - 1:1 square 512x512, SD1.5 - 2:3 portrait 512x768, SD1.5 - 3:4 portrait 512x682, SD1.5 - 3:2 landscape 768x512, SD1.5 - 4:3 landscape 682x512, +12 |
| scale | FLOAT | 1.00.1–8 | — |
| divisor | INT | 81–512 | — |
| image_color | COMBO | white | 6 options: white, black, gray, red, green, blue |
| batch | INT | 11–9999 | — |
| latent_type | COMBO | standard | 4 options: standard, sd3, hunyuan, ltx |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| latent | LATENT | — |
| width | INT | — |
| height | INT | — |
| batch_num | INT | — |