Nodes/ComfyUI-FunPack/FunPack Empty Latent
ComfyUI Node

FunPack Empty Latent

Stop hand-typing latent dimensions for video models

By digital-garbage·Created about a year ago·Updated about 14 hours ago· 20
FunPack Empty Latent
  • model
  • audio_vae
  • latent
  • status
◄width768►
◄height512►
◄length1►
◄batch_size1►
◄frame_rate25.00►

Core's Empty Latent Image was built for a world where every latent was 4 channels, downscaled by 8, and had no time axis. That world ended. A video model might want 16 channels with 4× temporal compression, or 128 channels at /32 spatial, or - in the case of MiniMax H3 - a nested latent with a video branch and an audio branch, a channel count that doesn't match what its own format reports, and a frame grid it snaps to. FunPack Empty Latent reads the model you wired in and builds the shape that model actually wants.

The mechanism, and why it's fussy

Two paths, again with order mattering.

A model module can claim the job and build the latent itself. H3 does, because its latent genuinely can't be derived: it's a NestedTensor of video plus audio, and its length snaps to a model-specific frame grid.

Otherwise it derives. It reads the model's latent_format for channel count, spatial ratio and temporal ratio, then computes height/width divided down and frames = ((length - 1) // temporal) + 1. That's correct for anything with a single spatial latent - SDXL, Wan 2.1, LTXV - including models that ship after this node was written. It also reports back the downscale ratios it used, so the sampler can rescale if the model wants something different.

Two refusals are baked in, and both are the interesting part. A one-axis latent is refused outright: the same rank means seconds of audio for one model and tokens of geometry for another, so there's nothing to derive from. And a claimed model that fails to build stops the node instead of falling through to the generic derivation - the source calls out why: at length=124, the naive derivation gives 31 latent frames where H3's real grid is 37. A 16% shorter video, reported as a success. That's the exact class of silent wrongness this node is built to avoid.

What you actually set

model comes first and is not optional - the shape is its shape. Then width and height, both snapping to multiples of 16, and length.

The length widget is the one people misread. It's frames, not seconds and not latent samples. The tooltip says it plainly. On a 24fps video model, a five-second clip is around 121 frames; typing 5 gives you five frames and a clip that's over before it starts.

batch_size does what you'd expect. Then there's the audio pair, which only matters on models that generate sound and size a sound latent from a VAE: audio_vae plus frame_rate. How long the sound latent is depends on the frames per second you declare, so get that number honest - 25 and 24 are not interchangeable when the audio branch is in play.

Outputs are latent (into the sampler, or into anything expecting a starting latent) and status, a string that tells you which path built it. On a new model family, read the status before you read anything else.

Install

ComfyUI Manager → search ComfyUI-FunPack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/olivv-cs/ComfyUI-FunPack
pip install -r ComfyUI-FunPack/requirements.txt

Same Python environment as ComfyUI, then restart. FunPack's real dependency list is short - comfy-kitchen>=0.2.32 for one attention kernel, plus gguf for quantized text encoders - and it uses your existing torch. Model files go where ComfyUI expects them: models/diffusion_models, models/text_encoders, models/vae.

Do check Settings ▸ About FunPack after installing. Manager installs what's published on the Registry, and 5.0 only shows up there once it's published; the current release is the v5 "Cunning Cranberry" rewrite, which is a different app from FunPack 4 and does not import 4.x projects.

Troubleshooting

"This model's latent has a single axis whose length is not derivable…" You're on a model whose latent is audio samples or geometry tokens. That's a module-covered model, not a derivable one - and no, guessing length as a sample count doesn't help.

"This model does not publish a latent format." Some exotic loader isn't exposing the metadata. Nothing to derive from, so it says so instead of inventing a shape.

Video comes out shorter or longer than you asked for. Check length is frames and that the model's frame grid allows the number you typed. H3 in particular snaps; ask for 124 and the model decides what 124 means.

LTX users: the audio VAE path is wired for LTX, but the pack's own README marks LTX 2.x as untested - "never run on a real LTX model, and nobody plans to test it soon." Fun, honest, and worth calibrating your expectations against.

CategoryFunPack/Latent

Inputs (7)

NameTypeDefaultDescription
modelMODELThe latent's shape comes from this model.
widthINT76816–16384—
heightINT51216–16384—
lengthINT11–16384Frames. Ignored by models whose latent has no time axis, and it is frames -- not seconds and not samples.
batch_sizeoptINT11–4096—
audio_vaeoptVAEOnly for models that generate sound alongside the picture and size its latent from this VAE (LTX).
frame_rateoptFLOAT25.001–1000Only used with an audio VAE: how long the sound latent is depends on the frames per second.

Outputs (2)

NameTypeDescription
latentLATENT—
statusSTRING—