RuYi 空Latent图像
Chained to the wrong channel count, your Flux run dies quietly
- LATENT
Core ComfyUI ships empty latents as two nodes in a trench coat. EmptyLatentImage makes a 4-channel tensor, defaulting to 512×512 because it's from the SD 1.5 era. EmptySD3LatentImage makes a 16-channel one, defaulting to 1024, because SD3, Flux and the Qwen/Lumina-derived models need a wider latent. Pick wrong and the mismatch shows up late - an error at the sampler, or a decode that produces noise.
RuYi 空Latent图像 merges both behind one node, then adds the things you actually want after your five-hundredth generation: a width/height swap, saved resolution presets, an alignment lock, and a proportional scaler that doesn't fight you. It's a quality-of-life node, and honest about it.
What it actually does
The mechanism is four lines of PyTorch, read straight from ruyi_empty_latent.py:
shape = [batch_size, channels] # channels = 4 or 16
if latent_type == 'Anima (16)':
shape.append(1) # extra frame axis
shape.extend([height // 8, width // 8])
latent = torch.zeros(shape, ...)
Both layouts downsample 8× per side, which is why every latent dimension in ComfyUI is your pixel size divided by eight. The output is the standard {"samples": tensor} dict (plus a downscale hint), so anything downstream that accepts a core LATENT - any sampler, any latent upscale, VAE Decode - takes this without complaint.
The inputs that matter
Five inputs, and only one of them is a trap.
width / height - 16 to 16384, default 1024×1024. The alignment rules below round your entry at execution time, so you can type 1217 and get 1216.
batch_size - 1 to 4096. Nothing exotic.
alignment - 8, 16, 32 or 64, default 16. This is your pixel grid, and it rounds to the nearest multiple, not down. Use 16 for SDXL-family checkpoints and 64 for anything Flux-derived, since Flux wants dimensions divisible by 64. (The KB's resolution table in concepts.md is worth having open: SDXL's trained ratios are 1024×1024, 1152×896, 1216×832, 1344×768, 1536×640 and their rotations, and generating at four-degrees-off aspect ratios is the classic stretched-body complaint.)
latent_type - this is the one that bites. SD3 / Flux (16) is the default and gives 16 channels. SD1 / SDXL (4) gives the native 4-channel layout that core EmptyLatentImage produces. Anima (16) is 16 channels with a single leading frame dimension - a 5D tensor, the shape the Wan/Qwen-family VAE code paths want, and Anima sits directly on that Cosmos-Predict2 lineage.
The node's own documentation makes the point because people keep getting it backwards: alignment and latent type are independent. Alignment 16 does not mean 16 channels. Alignment constrains pixels; latent type decides channels and layout.
Output: one LATENT, wired into your sampler's latent_image.
The tricks worth knowing
Resolution presets are dims-only and deduplicated on save, so you can build a little library - 1024², the SDXL portrait ratio 832×1216, 1600×1088, the 1280-ish first pass that the KB's Anima panel notes is the most coherent one for that model.
Two caveats. Presets live in this browser's local storage, so they don't travel in the workflow JSON and don't follow you to another machine. And if you right-click width and Convert to input, the node's local resolution controls go dead - the wire wins by design, which is correct, but it looks like the arrows stopped working.
Install
ComfyUI Manager, search RuYi-Nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/RuYi-Xiao/RuYi-Nodes.git
Then restart ComfyUI. There's nothing to download and nothing to pip install - the pack declares zero dependencies in pyproject.toml, and it's pure Python plus frontend JS. If you install from the ZIP instead, make sure __init__.py sits directly inside custom_nodes/RuYi-Nodes/ and you haven't got a second nested folder with the same name. Updates are git pull in the pack folder, then Ctrl+F5.
Troubleshooting
It's brand new. RuYi-Nodes is at version 0.2.0, released 2026-10-02, and the node itself landed in that release. There is essentially no community track record to lean on yet - the code is clean and small, but you are an early user. Bug reports go to the repo's Issues tab, and the author writes in both English and Chinese, so either is fine.
Wrong output looks like a broken model. If you're on a 16-channel VAE (Flux, SD3, Qwen-family) and you let this default to SD3 / Flux (16), you're fine. If you deliberately chose SD1 / SDXL (4) for a Flux run, expect garbage rather than a subtle quality dip, and check this dropdown before you start rewriting your sampler settings.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
| batch_size | INT | 11–4096 | — |
| alignment | COMBO | 16 | 4 options: 8, 16, 32, 64 |
| latent_type | COMBO | SD3 / Flux (16) | 3 options: SD3 / Flux (16), Anima (16), SD1 / SDXL (4) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |