FunUI Empty Latent
How FunUI Empty Latent Gets Its Shape
- model
- audio_vae
- latent
- status
Here's the thing beginners trip on: the width and height you type into an empty-latent node are not the numbers the model ever sees. They get divided by the model's own latent compression, the spacing has to land on that model's grid, and for video there's a third axis with a completely different divisor. Classic ComfyUI empty latents assume you know all that. FunUI's version reads it off the model you wired in.
That's the whole trick, and it's the reason to pick this over the stock node.
What it actually does
The node asks the model what its latent format looks like - spatial downscale ratio (commonly 8), temporal downscale ratio, channel count, and rank. Then it builds the right tensor.
Rank 3 (video, H3/LTX-style) gets a five-dimensional [batch, channels, frames, h, w] latent. Rank 2 (SD1.5 and friends) gets the flat four-dimensional one. Frames are computed as ((length - 1) // temporal) + 1, so a temporal ratio of 4 turns 121 requested frames into 31 latent frames - the arithmetic the model expects, not the arithmetic you clicked.
It also attaches downscale_ratio_spacial and downscale_ratio_temporal to the latent, which is not decoration: FunUI Sampler reads them and calls ComfyUI's fix_empty_latent_channels so a model that wants different ratios gets the latent rescaled rather than silently sampled at the wrong size. Skip the pair and nothing errors - you just get the wrong picture with no complaint.
Inputs and outputs
The three you set every time:
- model - required, and not just for wiring's sake. All the shape maths comes from it. The tooltip is blunt about it: the latent's shape comes from this model.
- width / height - default 768×512, step 16, up to 16384. Note the default isn't the 512×512 you'd expect; it's a landscape frame, which tells you which model this pack was built around.
- length - frames. The tooltip says it twice, so I will too: frames, not seconds, not "samples". Ignored entirely by models whose latent has no time axis, so leaving it at 1 on SD 1.5 costs nothing.
Optional, and only for one family:
- batch_size - how many latents in one go.
- audio_vae - an LTX thing. Models that generate sound alongside picture size their audio latent from the VAE itself, so you hand one over.
- frame_rate - only used with an audio VAE: sound duration is frames divided by fps, so getting this wrong gives you correctly shaped video with audio that's the wrong length.
Outputs are latent and status. The status string tells you who built it - either a named model module ("X built this latent") or the generic path ("shaped from the model's own latent format"). If a model module claimed your architecture and then threw, the node refuses rather than substituting a plausible shape, because a silently wrong latent is much worse than a red node.
Installing it
Same pack, same steps. Manager: search FunUI. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/digital-garbage/FunUI
cd FunUI && pip install -r requirements.txt
Restart ComfyUI. The node appears under FunUI/Latent. No model files of its own to download - it reads whatever your pipeline's model loader gave you. (Yes, the pack page says olivv-cs/ComfyUI-FunPack and the repo is now digital-garbage/FunUI. Same project, renamed; no migration needed.)
Where people get burned
Length in seconds. People ask for "5 seconds" at 25 fps, type 5, get 5 frames and a still image. 125. It's frames.
Rank-1 latents are refused on purpose. Audio-only or 3D-gen models publish a latent with a single axis whose length can't be derived - seconds, sample rate and hop live in the node, not the model - so this node raises instead of inventing a shape three orders of magnitude off. That's a considered refusal, not a missing feature.
Big numbers are legal, not wise. The maxes go to 16384, which is a shape you can ask for and absolutely cannot afford to sample. Work back from your VRAM, not from the slider's limit.
Wire the empty latent after the model, not before. If you build the graph latent-first you'll have picked a model in your head, not in the node, and the shape will come from whatever got wired - which on a two-model workflow is a genuinely confusing bug to chase.
And the usual day-one gotcha for anything 2026-shaped: a video latent that fits is not the same as a run that fits. The text encoder is its own VRAM budget, so a 720p-ish H3 latent can OOM before the first step even though the node was happy. That's the model, not the latent.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The latent's shape comes from this model. | |
| width | INT | 76816–16384 | — |
| height | INT | 51216–16384 | — |
| length | INT | 11–16384 | Frames. Ignored by models whose latent has no time axis, and it is frames -- not seconds and not samples. |
| batch_sizeopt | INT | 11–4096 | — |
| audio_vaeopt | VAE | Only for models that generate sound alongside the picture and size its latent from this VAE (LTX). | |
| frame_rateopt | FLOAT | 25.001–1000 | Only used with an audio VAE: how long the sound latent is depends on the frames per second. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| status | STRING | — |