TK 空Latent 图像
The Anima latent node that won't let you pick a bad size
- latent
- width
- height
Anima's latent is not SDXL's latent. That's the whole reason this node exists.
Anima is a 2B DiT built on NVIDIA Cosmos-Predict2 with a Qwen-Image VAE, so its latents are five-dimensional and single-frame - [batch, channels, frames, height, width], with the frame axis sitting there even when you're only making a still. The layout mirrors ComfyUI's own EmptyCosmosLatentVideo node; the pack's source says so outright. If you've ever wired a generic empty-latent into an Anima graph and got a shape error or something quietly wrong, that mismatch is why.
TK 空Latent 图像 is the pack's version, with the resolution presets you'd otherwise look up every time. It's one of the utility nodes in TK Toolkit (anima-toolkit by 时运tk).
What it emits
Under the hood it's a tensor of zeros with the shape [batch_size, 16, 1, height // 8, width // 8]. Sixteen channels, one frame, 8× spatial compression - that's the Anima/Cosmos VAE's ratio, and it's the number that has to be right. The node creates it on ComfyUI's intermediate device, so it's a cheap object that doesn't fight your model for VRAM.
It also refuses bad input loudly rather than silently. If width or height isn't a multiple of 16, you get an explicit error instead of a subtly misaligned generation. The widgets already step by 16, but the check is there for API/scripted use and for workflow values injected by other nodes.
Inputs and outputs
Only three inputs, and two of them are the ones you care about:
- width - default 1024, minimum 16, step 16.
- height - same.
- batch_size - default 1, up to 4096. One latent per image; this is a plain batch, not a video length.
Three outputs, and the second two are the point of the node:
- latent - the LATENT to feed your sampler.
- width and height - INT passthroughs of whatever you actually set.
Those passthroughs save you from the classic bug where you change the latent size and forget the upscale node, or the save-prefix template, still says 1024×1024. Wire them into anything that needs to agree with the canvas.
The UI does the arithmetic
The fun part isn't in the schema, it's in the widget. Two columns of scale buttons - 0.5–0.9 down one side, 1.1–1.5 down the other - multiply the current width and height in one click. And the aspect-ratio menu lists concrete resolutions keyed to a 1536px long edge, with the multiplier shown next to each, rounding everything to multiples of 16.
That 1536 anchor is not arbitrary. Anima's base v1.0 raised the training resolution from 1024 to 1536, and 1536² works properly where earlier previews merely tolerated it. It's also the top of the comfortable range: 2048² generates, less consistently.
One nuance worth carrying in: several users doing side-by-sides found the first pass held composition together better around 1280, with a second sampling pass at the latent level bringing it up - particularly for two characters interacting, where 1536 first-pass anatomy got flaky across seeds. So the scale buttons aren't just for framing; nudging 1536 down toward the 0.8–0.85 zone is a legitimate first-pass strategy, and the width/height outputs make the second stage easy to keep honest.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Ararararararaki/comfyui-anima-toolkit
# restart ComfyUI
Or search TK Toolkit in ComfyUI Manager (anima-toolkit on the registry). Hard dependencies are aiohttp and requests; nothing to download, no models involved. The node lives under TK/latent.
You'll also need Anima's companions loaded properly - a Qwen3 text encoder and the Qwen-Image VAE come as separate files, so a graph that errors on a missing CLIP or VAE usually means you grabbed the diffusion weights and skipped the rest of the model card. That failure looks unrelated to this node but shows up right next to it in the queue.
Things that bite
Multiples of 16 or nothing. The error message is clear, so this is mostly a scripting hazard - if another node computes your width, make sure it lands on a multiple of 16.
Batch size is a batch, not frames. Setting batch_size: 4 gives you four stills per run. There's no video length here, and single-frame is deliberate.
Don't route it into video nodes expecting a temporal dimension. The frame axis exists to satisfy Cosmos consumers, not to make a clip. Anything doing temporal work wants the actual video latent node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102416–16384 | 输出图像宽度(像素),必须是 16 的倍数。 |
| height | INT | 102416–16384 | 输出图像高度(像素),必须是 16 的倍数。 |
| batch_size | INT | 11–4096 | 一次创建的空 latent 数量。 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| width | INT | — |
| height | INT | — |