Nodes/ComfyUI-Terefang-Nodes/Terefang Simple Latent Image
ComfyUI Node

Terefang Simple Latent Image

A blank latent for SDXL sizes, minus the typing

By terefang·Created 10 months ago·Updated 10 months ago· 0
Terefang Simple Latent Image
    • LATENT
    width_x_height

    This is the Empty Latent Image node, rebuilt around a dropdown. Instead of two number fields and a batch count, you pick one of eleven preset resolutions and out comes a blank LATENT tensor, ready to feed a sampler. That's the entire node. It exists so you don't have to type 1024 and 1024 and hope you got them the right way round for the fortieth time.

    Why does a blank latent matter at all? Every ComfyUI image pipeline starts with one. The diffusion model doesn't denoise a blank canvas - it denoises a compressed, 8x-downscaled representation of one called the latent, and this node hands the sampler that empty starting tensor. From there it's the same graph as always: latent into KSampler, KSampler into VAE Decode, done. If you've built even one basic workflow you've already used this shape of node; you just used ComfyUI's built-in one.

    The one design decision here is the preset list, and it's a good one. Those eleven choices - 1024x1024, 896x1184, 1152x896, 1216x832, 1344x768, 1536x640 and their rotations, plus a couple of in-betweeners like 848x1264 - are the standard ~1MP SDXL generation sizes, all divisible by 64, all hovering around the model's native resolution. That's not trivia: generating way off a model's training resolution is how you get stretched limbs, duplicate anatomy, and tiling artifacts (a recurring theme in r/StableDiffusion "why does my image look like this" threads). A dropdown that only lets you pick sane sizes quietly prevents the most common newbie error. If you're on SDXL, Flux, or an Illustrious/Pony fine-tune, one of these presets is the right answer almost every time.

    Under the hood it's embarrassingly simple - the source is a single generate() method. It splits the width_x_height string on the x, then allocates torch.zeros([1, 4, height // 8, width // 8]) on ComfyUI's intermediate device. Batch of 1, four latent channels, and both dimensions divided by 8 because that's the VAE's downsampling factor. No noise, no content, just zeros the sampler will add noise to. The whole thing is maybe a dozen lines.

    The inputs that matter

    There's exactly one: width_x_height, a dropdown of the eleven presets above. That's all. Note what's not here: no batch size input. The built-in Empty Latent Image lets you batch N copies at once; this one always emits a single latent. Need batch? Use the built-in. Need an oddball size like 1280x704? Same answer - this node only knows its eleven presets, and that's the trade you're making for the convenience.

    Output

    One output: LATENT - "The empty latent image batch." It plugs into the latent_image input on KSampler (or any sampler), and downstream of that into VAE Decode's samples. The tooltip is the author's own, and it's accurate.

    Installing it

    This ships in a small pack called ComfyUI-Terefang-Nodes (by Alfred Reibenschuh, a.k.a. Terefang). Two routes, both standard:

    # ComfyUI Manager: search "ComfyUI-Terefang-Nodes", hit Install, restart.
    # Or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/terefang/ComfyUI-Terefang-Nodes
    # restart ComfyUI
    

    Good news: there's no requirements.txt, no model downloads, no torch-version dance. It imports only torch and core ComfyUI modules, so it installs clean in about ten seconds. This is the right weight for what it does.

    When to just skip it

    Honest take: it's a convenience node, not a capability one, and the built-in Empty Latent Image does 90% of the job. Grab it if you like the preset list (it's the Fooocus-era SDXL list, and it's a nice crutch) or if you're sharing workflows where you don't want people fat-fingering resolutions. If you need custom sizes or batches, you'll reach past it - and that's fine, because there's nothing else here to break. About the only thing that could trip you up: there are no small SD 1.5-sized presets (512-ish), so on a 1.5 checkpoint you'd be picking from off-native resolutions. The pack itself is a two-node side project, brand new and lightly used - expect exactly this level of polish, and no more.

    Categorylatent

    Inputs (1)

    NameTypeDefaultDescription
    width_x_heightCOMBO11 options: 1024x1024, 896x1184, 848x1264, 1152x896, 896x1152, 1216x832, +5

    Outputs (1)

    NameTypeDescription
    LATENTLATENTThe empty latent image batch.