Nodes/ComfyUI-UniversalToolkit/Empty Unit Generator (UTK)
ComfyUI Node

Empty Unit Generator (UTK)

A blank canvas, mask, and latent in one node — for testing and layout

By whmc76·Created about a year ago·Updated 2 months ago· 72
Empty Unit Generator (UTK)
    • image
    • mask
    • latent
    • width
    • height
    • batch_num
    width1024
    height1024
    ratioSDXL - 1:1 square 1024x1024
    scale1.0
    divisor8
    image_colorwhite
    batch1
    latent_typestandard

    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 custom to 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, or hunyuan (the source also supports ltx). 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 custom to 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.

    CategoryUniversalToolkit/Image

    Inputs (8)

    NameTypeDefaultDescription
    widthINT102464–4096
    heightINT102464–4096
    ratioCOMBOSDXL - 1:1 square 1024x102418 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
    scaleFLOAT1.00.1–8
    divisorINT81–512
    image_colorCOMBOwhite6 options: white, black, gray, red, green, blue
    batchINT11–9999
    latent_typeCOMBOstandard4 options: standard, sd3, hunyuan, ltx

    Outputs (6)

    NameTypeDescription
    imageIMAGE
    maskMASK
    latentLATENT
    widthINT
    heightINT
    batch_numINT