Nodes/ComfyUI-DD-Nodes/DD Simple Latent
ComfyUI Node

DD Simple Latent

An empty latent that also hands you its own dimensions

By Dontdrunk·Created 2 years ago·Updated 24 days ago· 182
DD Simple Latent
    • 潜空间
    • 宽度
    • 高度
    宽度512
    高度512

    ComfyUI's EmptyLatentImage has been there since day one, so a replacement has to justify itself. DD Simple Latent's pitch is in its outputs: it produces an empty latent and the width and height it actually used, as clean INTs. That single addition saves you from wiring a separate size node into the graph every time you need to know what resolution your latent really is.

    How it works

    You give it 宽度 (Width) and 高度 (Height), each 64–8192. It rounds both down to the nearest multiple of 8, creates a zero-filled latent tensor of shape [1, 4, height/8, width/8] - the standard 8× VAE compression, four latent channels - and returns three outputs: the 潜空间 (Latent), the rounded 宽度, and the rounded 高度. The rounding detail matters more than it looks: type in 515 and you get a 512-wide latent, and the outputs tell you so instead of leaving you to guess. It's the same data path as EmptyLatentImage (zero latents → full denoising), so it feeds a KSampler exactly like the built-in node.

    When you'd reach for it

    The standard text-to-image pipeline: empty latent → KSampler → VAE decode. The dims outputs make it shine in slightly bigger graphs - when a later node (an upscaler by factor, a ControlNet, a size-based math step) needs to know the actual resolution, you grab the INT outputs instead of reconstructing them. It also pairs with the pack's DD-DimensionCalculator or DD-AspectRatioSelector to build size-aware workflows without a tangle of converter nodes. And because the width/height outputs are plain INTs, you can drive conditions off them.

    Installation

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Dontdrunk/ComfyUI-DD-Nodes
    cd ComfyUI-DD-Nodes && pip install -r requirements.txt
    

    Restart ComfyUI or use ComfyUI Manager (search "ComfyUI-DD-Nodes"). It's pure torch - no models, no extra dependencies beyond the pack's shared requirements.

    Honest take

    Be honest: if you never need the size back, this node buys you nothing over EmptyLatentImage, and you should just use the built-in. But "latent plus its own dimensions" is a real convenience that saves a node or two in dimension-aware graphs, and it's already there once DD-Nodes is installed. Two details worth knowing: the rounding is down to a multiple of 8 (don't expect 8200 to round to anything sane - the max is 8192), and a single latent is produced - there's no batch count input, so if you need N latents you'll repeat or batch elsewhere. As with the whole pack, labels default to Chinese, with an English locale in ComfyUI settings.

    Category🍺DD系列节点

    Inputs (2)

    NameTypeDefaultDescription
    宽度INT51264–8192
    高度INT51264–8192

    Outputs (3)

    NameTypeDescription
    潜空间LATENT
    宽度INT
    高度INT