NF Empty Latent Image
NF Empty Latent Image
- latent
- width
- height
The core Empty Latent Image node asks you for two numbers: width and height. That's it. Which means every time you want a 16:9 image you open a calculator, work out that 1024 × 9 ÷ 16 = 576, then double-check that 576 divides nicely by 8, then do it again for 21:9 and discover you need 448 instead of 439. NF Empty Latent Image exists so you never do that arithmetic again. You give it the size of the long side and an aspect ratio, and it works out both dimensions for you - and hands them back as width / height integers you can wire into the rest of the graph.
Why you'd reach for it
Resolution is not a free parameter in diffusion. Every architecture has a native resolution it was trained at, and drifting off it produces the classic failure set - elongated bodies, doubled heads, tiled patterns. SDXL is trained on a discrete set of ratios (1024×1024, 1152×896, 1216×832, 1344×768, 1536×640 and their rotations), SD 1.5 lives at 512, and the newer 2026 models are looser but still want their pixel counts divisible by 64. Getting those numbers wrong is one of the most common beginner injuries, and it looks like a model problem rather than a settings problem.
So you want to be deliberate about aspect ratio. This node is the deliberation made cheap: pick 16:9, pick a long side, done. And because it also outputs the resolved width/height as plain INTs, you can fan them into a second pass - a hires-fix sampler, an upscaler, a SaveImage filename template - instead of re-typing the same numbers in three places and getting one of them wrong.
How it works
The maths lives in a small pure module, nodes/empty_latent/dimensions.py, and it's worth knowing because the numbers in the dropdown are not what you might assume. long_side is always the long side of the result - the bigger of the two dimensions. The aspect ratio supplies a pair like 16:9, one dimension is derived from the other, and then orientation can flip the result: on auto you get whatever the ratio implies (so 16:9 gives you landscape, 9:16 gives you portrait), while portrait or landscape force the long side onto the axis you asked for.
If force_multiple_of_64 is on - and it defaults to on - both numbers get rounded to the nearest multiple of 64 (the code is ((value + 32) // 64) * 64, i.e. round-half-up, not truncate). With it off you get the exact ratio, which is fine for the VAE's /8 but not what attention blocks prefer. The latent itself is a plain torch.zeros([batch_size, 4, height // 8, width // 8]) on ComfyUI's intermediate device, exactly like the core node.
The inputs that matter
Only five, and you'll touch three.
long_side- INT, 64 to 8192, step 64, default 1024. The size of the long edge. This is your resolution dial.aspect_ratio- one of1:1,5:4,4:3,3:2,16:9,21:9,4:5,3:4,2:3,9:16. Default1:1.orientation-auto(follows the aspect ratio),portrait,landscape. Defaultauto. You mostly leave this alone and let9:16do the talking.batch_size- 1 to 4096, default 1. Bump it to generate several candidates and let Preview Selector pick.force_multiple_of_64- BOOLEAN, default true. Turn it off only if you specifically want the exact ratio and know your model tolerates it.
Outputs: latent (wire it into your KSampler), and width / height as INTs - the values actually used after rounding, not the ones you typed. Those two are the quiet feature: right-click a width widget somewhere downstream, convert it to an input, and drive it from here so every stage of the pipeline agrees on the size.
Installing it
The whole pack installs as one unit. Via ComfyUI Manager, search for ComfyUI-NF_Suite (the pack registers as "NF Suite" by publisher nyafu) and install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/NyaFuP/ComfyUI-NF_Suite.git
Then restart ComfyUI. There is nothing else to do: pyproject.toml declares no runtime dependencies, there's no requirements.txt, and the built frontend ships in the web/ folder, so no Node.js either. You'll find the node under NF Suite/latent in the Add Node menu.
Common issues
The nodes don't appear at all. This pack is written against ComfyUI's V3 node API (from comfy_api.latest import ...), which means it needs ComfyUI 0.22.0 or newer and frontend 1.44.19 or newer. On an older install the pack fails to import and you get nothing in the menu. Check the console output at startup rather than assuming you cloned it wrong. Related tell: this pack has no NODE_CLASS_MAPPINGS at all, which reads as broken if you're used to older custom nodes - it isn't, it's just new.
"1024 × 576 is a multiple of 64, why did I get 1024 × 576?" Because it already was. The rounding only shows up on awkward ratios - 21:9 at a long side of 1024 gives you 439 before rounding and 448 after.
Don't treat 8192 as a legal resolution. The widget will happily accept it; your sampler will not enjoy it. Generating far above the model's native resolution gets you tiled patterns and duplicated anatomy, which is what the two-pass hires-fix pattern exists to avoid. Use this node to set a sane first-pass size, then upscale - and keep batch_size to what your VRAM can actually hold, since eight samples in flight multiply the sampler's activations even though the latent itself is tiny.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| long_side | INT | 102464–8192 | Size of the long side (pixels) |
| aspect_ratio | COMBO | 1:1 | Select aspect ratio |
| orientation | COMBO | auto | Specify orientation (auto follows aspect ratio) |
| batch_size | INT | 11–4096 | Batch size |
| force_multiple_of_64 | BOOLEAN | true | Force size to be a multiple of 64 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | Empty Latent Image Batch |
| width | INT | Calculated Width (pixels) |
| height | INT | Calculated Height (pixels) |