Empty Latent Image (orientation)
An Empty Latent That Won't Let You Generate the Wrong Orientation
- LATENT
Every txt2img workflow starts with an empty latent - a blank tensor at the model's native resolution that the sampler fills with noise, then image. The core Empty Latent Image node is fine at this. This version adds one thing: an orientation dropdown that fixes your canvas shape for you, so you stop generating 512x768 when you meant landscape.
Why you'd reach for it
It's a small quality-of-life node, and that's okay - the pack is full of exactly these. If you build a lot of portrait or landscape workflows, the orientation enum is the whole pitch: pick force-landscape and it guarantees width ≥ height by swapping your numbers, pick force-portrait and it does the reverse. original behaves like the core node. For a fixed-use workflow you can stop double-checking dimensions and just trust the orientation dropdown to enforce the shape you mean. It also matters more than it sounds for SD 1.5 and SDXL, where generating outside native-ish resolutions is where the repetition artifacts and warped anatomy creep in.
How it works
Nothing exotic: it creates a zero tensor of shape [batch_size, 4, height//8, width//8] - the //8 is the VAE's 8x downscale factor, so 512x512 pixels becomes a 64x64 latent. The orientation logic runs before that: for force-landscape, if your height exceeds your width it swaps them, and vice versa for force-portrait. Then it returns the standard latent dict a sampler expects.
Inputs and outputs
- width / height - default 512 each, stepped in multiples of 8.
- batch_size - default 1, up to 4096.
- orientation -
original,force-landscape, orforce-portrait.
Output: LATENT, straight into your sampler (or into a batch/upscale node first if that's your workflow).
Installing it
Part of "quadmoon's ComfyUI nodes". ComfyUI Manager: search the pack title or Install via GIT URL with https://github.com/traugdor/ComfyUI-quadMoons-nodes.git. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/traugdor/ComfyUI-quadMoons-nodes.git
Restart ComfyUI. No models or dependencies.
Common issues
The orientation swap happens on the values you typed, not on some stored preference - so force-landscape with 512x512 does nothing (it's already square), and the dropdown won't remember your last choice. Also remember this is the blank canvas node: if you're doing img2img, you don't want this at all - you want to VAE-encode your existing image instead. People wire an empty latent into an img2img graph and wonder why they get a fresh unrelated image; that's the classic sign you reached for the wrong node.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51216–16384 | — |
| height | INT | 51216–16384 | — |
| batch_size | INT | 11–4096 | — |
| orientation | COMBO | 3 options: original, force-landscape, force-portrait |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |