ComfyUI Node

Empty

A blank string and a blank latent, and more useful than that sounds

By MarwanDSAI·Created 2 months ago·Updated about 22 hours ago· 3
Empty
    • empty_string
    • empty_latent
    ◄width512►
    ◄height512►
    ◄batch_size1►

    "Empty" is the kind of node that looks like a joke until you build a workflow with four optional branches and discover that satisfying a required input with nothing is genuinely hard.

    What it's for

    ComfyUI's optional inputs are forgiving - leave one unwired and the node's function just doesn't receive it. Required inputs are not. And a lot of nodes you'd like to gate are wired as required: a text input that must exist before the node will run, a latent input that a downstream sampler insists on. If you want the "off" state of a branch to still execute, something has to occupy that socket.

    That's the job. Empty outputs an empty string and an all-zeros latent, so you can park a blank value on a required input and let the branch run harmlessly, or feed it as the fallback_value on Get Value (Global) from the same pack so the "no value set" path has something to hand downstream instead of None.

    The zero latent is the second use: a placeholder that keeps a graph structurally complete while a switch picks the real one. Think of it as the empty carton you put in the fridge so the shelf bracket doesn't collapse.

    How it works

    Read the source and it's about ten lines. It builds "" for the string, then constructs a latent tensor with torch.zeros([batch_size, 4, height // 8, width // 8]) and wraps it as {"samples": tensor} - which is exactly the shape ComfyUI's own Empty Latent Image uses.

    The inputs are the three you'd expect from an empty-latent node:

    • width - default 512, min 16, max 16384, step 8. Multiples of 8 because the latent is the pixel grid divided by 8.
    • height - same story, default 512.
    • batch_size - default 1, max 4096, "number of latents in the batch."

    Outputs are empty_string (STRING) and empty_latent (LATENT). The string is the one you'll reach for most; the latent is the one that needs a caveat below.

    Installing it

    Part of ComfyUI-MDSNodes by MarwanDSAI, which you install through ComfyUI Manager (search ComfyUI-MDSNodes or MDSNodes) or by cloning:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MarwanDSAI/comfyui-mdsnodes
    # restart ComfyUI
    

    No pip installs, no downloads - the repo's requirements.txt is empty and the README states the pack runs on stock ComfyUI dependencies. It uses torch, but so does ComfyUI itself, so it's already there.

    Find it by searching Empty on the canvas; the friendly name is short enough to collect friends, and the pack's category is MDSNodes/Routing.

    Common issues

    Its latent broke a Flux/SD3-family sampler. This is real and it's a 4-channel latent, the same shape core's Empty Latent Image produces and the same shape SD1.5 and SDXL use. Models that want a 16-channel latent (the Flux and SD3 lineages) will complain about shape. If you're on one of those, use the model's own empty-latent node - or use this node purely for empty_string, which has no such restriction.

    width/height won't accept an odd number. Step 8, deliberately: latents are eighth-resolution, so a 1000px width would round somewhere you can't see and you'd spend an hour wondering where 8 pixels went.

    The sampler ran on the zeros and produced porridge. That's what a zeroed latent will do if it reaches a sampler as the only conditioning input - it's noise-free, not noise. It's a placeholder for slots that are meant to be inert, not a replacement for Empty Latent Image in a real generation.

    You can't find it after updating. This shipped in pack version 1.8.0, the big batch of routing and constant nodes from September 2026. Older clones don't have it.

    CategoryMDSNodes/Routing

    Inputs (3)

    NameTypeDefaultDescription
    widthINT51216–16384Width of the empty latent image.
    heightINT51216–16384Height of the empty latent image.
    batch_sizeINT11–4096Number of latents in the batch.

    Outputs (2)

    NameTypeDescription
    empty_stringSTRING—
    empty_latentLATENT—