Toggle Empty Latent
Two latent sizes on one node — flip a switch to A/B test resolutions
- LATENT
The built-in Empty Latent node gives you one width, one height, and one way to change them: drag another node in or rewrite the widget every time. Toggle Empty Latent is the lazy version - it holds two size settings on one node and a enabled switch that flips between them. That's it. That's the whole node, and for size A/B testing it's genuinely handy.
What it's for
The real use case is comparing resolutions without rebuilding your graph. Set width/height for your 1024×1024 baseline and fallback_width/fallback_height for the 512×768 variant. When enabled is ON you get the first pair; flip it to OFF and the node emits a latent at the fallback size instead. Same node, same wires, one dropdown change. The author's stated intent is exactly this - "useful for A/B size comparison" - and it's the rare toggle that's actually more ergonomic than just retyping a number, because you can flip back and forth without losing your two presets.
How it works
There's no mystery under the hood: it creates a zero-filled latent tensor with shape [batch_size, 4, height // 8, width // 8] and the standard downscale_ratio_spacial of 8. When enabled is anything but ON, it substitutes the fallback dimensions before building the tensor. If you don't wire the fallback widgets, they default to 1024×1024.
Inputs and outputs that matter
Required: width (default 1024, step 8), height (default 1024), batch_size (default 1), and enabled (ON/OFF). Optional: fallback_width and fallback_height. Output: a single LATENT, wired straight into a sampler's latent input the same way you'd use Empty Latent.
One small trap: because the fallback defaults to 1024×1024 when you don't set it, flipping enabled to OFF with unconfigured fallbacks silently changes nothing. Set the fallback pair before you start toggling, or you'll spend a confusing few minutes wondering why the image didn't get smaller.
The honest take
This is a thin utility - a convenience wrapper around Empty Latent with a second preset. If you never A/B test resolutions you'll never miss it. If you do, it's the difference between re-typing two numbers per experiment and flipping one dropdown, which adds up over a long tuning session. It has no dependencies beyond ComfyUI itself and no gotchas beyond the fallback-default one above.
Installing it
It ships with the rest of the Toggle-Pass pack:
cd ComfyUI/custom_nodes
git clone https://github.com/electricty00/ComfyUI-Toggle-Pass
then restart ComfyUI (or search "ComfyUI-Toggle-Pass" in ComfyUI Manager). There's no requirements.txt and nothing to install - just ComfyUI's bundled torch - so it can't break your environment. Like the rest of this small personal pack, it's a "built for my own workflow" node, and for the one thing it does it works as advertised.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
| batch_size | INT | 11–4096 | — |
| enabled | COMBO | 2 options: ON, OFF | |
| fallback_widthopt | INT | 102416–16384 | — |
| fallback_heightopt | INT | 102416–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |