Nodes/ComfyUI-SD3LatentSelectRes/SD3/Flux Select Latent Resolution
ComfyUI Node

SD3/Flux Select Latent Resolution

Stop hand-typing Flux resolutions — pick one from a dropdown

By GavChap·Created 2 years ago·Updated 7 months ago· 15
SD3/Flux Select Latent Resolution
    • width
    • height
    • samples
    size_selected
    landscapetrue
    batch_size1

    Flux and SD3 don't take just any resolution. You get one trained-ratio preset that works well, a handful that work okay, and a bunch of numbers that give you stretched faces and doubled anatomy. SD3LatentSelectRes is the answer to "which of those am I supposed to type again?" - a dropdown of 43 curated sizes that hands you both the pixel dimensions and a ready-to-sample empty latent. It's the resolution picker part of a stock SD3/Flux workflow, done for you.

    The node exists because the built-in EmptySD3LatentImage expects you to know the numbers. This one encodes them. Choose 1MP - 1:1 [1024x1024], 1MP - 3:2 [1216x832], whatever you need, and it returns the width and height as INT plus a LATENT you can drop straight into your KSampler. For Flux specifically, 1024x1024 is home base and the model stays happy into the two-megapixel range, so the presets from 1MP to 4MP cover the practical band - going past that is where you start tempting weirdness.

    How it actually works

    Under the hood it's a thin wrapper. The pack ships a sizes.json file of resolutions (credited in the README as "cunningly borrowed from humblemikey"), the node looks up your selection, and if the landscape toggle is off it just swaps width and height to give you the portrait version. Then it builds the latent itself:

    torch.ones([batch_size, 16, height // 8, width // 8]) * 0.0609
    

    Three numbers in that line matter. 16 channels because that's the SD3/Flux/Z-Image/Qwen VAE depth - not the 4 channels SD1.5 and SDXL use. //8 because the VAE compresses each side by 8x, so a 1024px image is a 128x128 latent. And 0.0609, the fill value, because that's the mean of the SD3/Flux latent space - the same one ComfyUI's own SD3/Flux empty-latent node uses, and not the 0.1 that older models get. Getting the fill wrong means a noisy or tinted first step; this node gets it right for you.

    The inputs that matter

    • size_selected - the 43-option dropdown. The tiers run 0.3MP to 4MP, and the 0.9MP (WAN) entries exist because Wan video shares the same 16-channel, 8x latent format, so the node works there too.
    • landscape - on by default. Flip it and the same preset becomes portrait. That's the whole feature.
    • batch_size - how many latent images to allocate, 1 to 4096. Leave it at 1 unless your sampler is doing batching.

    Outputs: width and height as INT (wire them into conditioning-area or resolution-math nodes), and samples, the LATENT that feeds your sampler's latent input.

    Installing it

    There are no dependencies, no model downloads, no requirements.txt to fight. Both nodes ship in one pack, so installing it once gives you this one and its V2 sibling.

    cd ComfyUI/custom_nodes
    git clone https://github.com/GavChap/ComfyUI-SD3LatentSelectRes
    

    Restart ComfyUI and it appears under generate/sd3. Or use ComfyUI Manager and search "SD3 Latent Select Resolution."

    The one thing that bites people

    This latent is only valid for 16-channel models: SD3, SD3.5, Flux, Z-Image, Qwen-Image, Wan. Wire samples into an SD1.5 or SDXL sampler and you'll get garbage or a hard crash, because those expect a 4-channel latent. That's not a bug - it's the model-family constraint the dropdown is quietly enforcing for you. Keep it on the models it's built for and it's about as foolproof as ComfyUI gets.

    The author, GavChap, is a community hobbyist who builds small utilities for their own Flux/Qwen work, and this one is exactly that: tiny, dependency-free, and it does one job well.

    Categorygenerate/sd3

    Inputs (3)

    NameTypeDefaultDescription
    size_selectedCOMBO43 options: 0.3MP - 4:3 [640x480], 0.3MP - 16:9 [736x416], 0.64MP - 1:1 [800x800], 0.64MP - 4:3 [928x688], 0.64MP - 3:2 [976x656], 0.65MP - 16:9 [1072x608], +37
    landscapeBOOLEANtrue
    batch_sizeINT11–4096

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    samplesLATENT