Nodes/wlsh_nodes/SDXL Quick Empty Latent (WLSH)
ComfyUI Node

SDXL Quick Empty Latent (WLSH)

SDXL Quick Empty Latent (WLSH)

By wallish77·Created 3 years ago·Updated 2 years ago· 144
SDXL Quick Empty Latent (WLSH)
    • latent
    • width
    • height
    resolution
    direction
    batch_size1

    This is SDXL Resolutions (WLSH)'s louder sibling - instead of just handing you width and height numbers to wire into a separate Empty Latent Image node, this one builds the actual empty latent for you in one step, batch size and all, and still gives you the width/height integers on the side. If your workflow starts with "pick an SDXL resolution, make an empty latent, and I also want the numbers for the filename later," this collapses that into one node instead of three.

    The five resolutions on offer - 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640 - are SDXL's actual multi-aspect training buckets, not a rounded-off convenience list. SDXL's positional encoding was trained on these specific pairs (and their portrait rotations), so generating at one of them is meaningfully safer against stretched anatomy and warped composition than picking an arbitrary width and height and hoping. This is the same list a lot of SDXL-realism workflows land on independently, because it's just what the model actually knows.

    Inputs: resolution is the same five-option enum, each entry showing its ratio (1024x1024|1:1 and so on). direction toggles landscape or portrait, swapping width and height accordingly. batch_size (1–64, default 1) sets how many latents you're generating in this run - bump it up if you want several variations from one prompt in a single queue instead of re-running the graph.

    Outputs, three of them: latent is the actual LATENT tensor, ready to plug straight into your sampler's latent_image input. width and height come back as plain INTs alongside it - genuinely useful for anything downstream that wants the numbers rather than the latent itself: an SDXL conditioning node's target_width/target_height fields, a filename string, or a crop calculation later in the graph.

    Installing it: ComfyUI Manager, search "wlsh_nodes"; or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wallish77/wlsh_nodes
    

    Restart ComfyUI. No models or extra dependencies - it's just latent-tensor construction plus a lookup table, nothing to download.

    A couple of things to keep in mind. This produces an empty latent - pure noise-ready blank space, same as the stock Empty Latent Image node, not something pre-conditioned or pre-generated. It's the starting point for a fresh txt2img generation, not something you'd feed into an img2img pipeline (for that you want a VAE Encode node on a real source image instead). And because batch_size scales your VRAM usage roughly linearly, cranking it up on a high resolution like 1536x640 can eat memory fast - if you get out-of-memory errors after bumping the batch, that's the usual suspect, not the node doing anything wrong. If you're already restricted on VRAM, generating at batch 1 and queuing multiple runs is the safer path than one big batch.

    CategoryWLSH Nodes/latent

    Inputs (3)

    NameTypeDefaultDescription
    resolutionCOMBO5 options: 1024x1024|1:1, 1152x896|9:7, 1216x832|19:13, 1344x768|7:4, 1536x640|12:5
    directionCOMBO2 options: landscape, portrait
    batch_sizeINT11–64

    Outputs (3)

    NameTypeDescription
    latentLATENT
    widthINT
    heightINT