Nodes/NF Suite/NF Preset Empty Latent Image
ComfyUI Node

NF Preset Empty Latent Image

NF Preset Empty Latent Image

By NyaFuP·Created 24 days ago·Updated 7 days ago· 1
NF Preset Empty Latent Image
    • latent
    • width
    • height
    ◄presetSDXL (1024x1024)►
    ◄batch_size1►
    ◄custom_width1024►
    ◄custom_height1024►

    Nobody remembers that SDXL's portrait ratio is 832×1216. You remember "SDXL portrait", and then you go look it up for the fifth time. NF Preset Empty Latent Image skips the lookup: pick a named size from a dropdown and it hands you the latent, plus the width and height it used as plain integers.

    Why you'd reach for it

    There are two Empty Latent nodes in this pack and they solve the same problem from opposite ends. NF Empty Latent Image is parametric - you give it a long side and a ratio and it computes. This one is discrete - you choose from a list of sizes that are already correct, and you can't accidentally land off-ratio because there's no arithmetic to get wrong.

    That matters most when you're targeting a known model. SDXL's trained ratios are specific values (1024×1024, 1152×896, 1216×832, 1344×768, 1536×640 and their rotations); a preset list means you generate where the model was trained instead of where your intuition says. The rest of the list is publishing-shaped: HD and Full HD for video-adjacent work, 4K for people who enjoy pain, and the Instagram sizes for when the target is a feed rather than a print. Then there's Custom, which is the escape hatch when none of the above is what you want.

    How it works

    The preset table is a literal dictionary of name-to-tuple in nodes/empty_latent/dimensions.py, so there's no cleverness to reverse-engineer - the name maps to two integers, and those go into the same torch.zeros([batch_size, 4, height // 8, width // 8]) latent the core node builds. Custom is the only entry that isn't a fixed tuple; it defers to the node's two optional inputs.

    What it deliberately does not do is round. The presets are already sane values, and a custom width/height is whatever you ask for - the widgets step in 64s and clamp to a minimum of 64, but there's no silent "snap it to a multiple of 64 for you" pass like the sibling node has. If you go custom, you own the numbers.

    The full list: SD 1.5 (512x512), SD 1.5 Portrait (512x768), SD 1.5 Landscape (768x512), SDXL (1024x1024), SDXL Portrait (832x1216), SDXL Landscape (1216x832), HD (1280x720), Full HD (1920x1080), 4K (3840x2160), Instagram Square (1080x1080), Instagram Portrait (1080x1350), Custom. Default is SDXL (1024x1024).

    The inputs that matter

    • preset - the dropdown above. This is the node.
    • batch_size - 1 to 4096, default 1. For a candidate batch you'll narrow down later, this is the dial.
    • custom_width / custom_height - optional INTs, 64 to 8192, step 64, default 1024 each. The tooltips are explicit that these are only read when preset is Custom, so don't sit there wondering why changing them does nothing on the SDXL preset.

    Outputs are latent (→ KSampler) and width / height - the values used, which is what makes them worth wiring somewhere. Feed them into a hires-fix second pass, a LatentUpscale, or a filename template so nothing downstream can disagree with the first pass about how big the image is.

    Installing it

    Manager, search ComfyUI-NF_Suite, install, restart - or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/NyaFuP/ComfyUI-NF_Suite.git
    

    No pip packages, no model downloads, no build step; the frontend is prebuilt in web/. You need ComfyUI 0.22.0+ and frontend 1.44.19+ because the pack is authored against the V3 node API. Nodes are under NF Suite/latent.

    Common issues

    Coming from NF_Tools? These two latent nodes are the same nodes, moved. The node ids (NFEmptyLatentImage, NFPresetEmptyLatentImage), input names, order, options and defaults were all kept identical on purpose so old workflows still load with their widget values intact. So don't run both packs at once - you'd have two nodes claiming the same id. If you have workflows from that era, the preview node is the one that actually needs attention; more on that in the Preview Selector article.

    Nothing shows up in the Add Node menu. Almost always a ComfyUI version problem, not an install problem. The pack imports comfy_api.latest, so anything older than 0.22.0 fails to load it silently-ish - check the startup console. It also has no NODE_CLASS_MAPPINGS, which is normal for V3-style packs and not a sign of a bad clone.

    A preset isn't a promise. 4K (3840x2160) and Full HD (1920x1080) are legal latent sizes and generally terrible generation sizes for older models; generating above the trained resolution is how you get tiled patterns and duplicated limbs. If you want 1920×1080 output, the reliable route is still generate at native resolution and upscale - the preset list is most useful as a record of what your target model actually wants.

    CategoryNF Suite/latent

    Inputs (4)

    NameTypeDefaultDescription
    presetCOMBOSDXL (1024x1024)Select preset size
    batch_sizeINT11–4096Batch size
    custom_widthoptINT102464–8192Custom width (only used when preset is Custom)
    custom_heightoptINT102464–8192Custom height (only used when preset is Custom)

    Outputs (3)

    NameTypeDescription
    latentLATENTEmpty Latent Image Batch
    widthINTUsed Width (pixels)
    heightINTUsed Height (pixels)