Nodes/raylight/Load VAE (Ray)
ComfyUI Node

Load VAE (Ray)

The quiet helper behind Raylight's ControlNet path

By komikndr·Created about a year ago·Updated 2 days ago· 409
Load VAE (Ray)
  • ray_actors
  • ray_vae
vae_name

Every pack has a node that does one boring job and never gets a shoutout. In Raylight, that's Load VAE (Ray). Its entire purpose is to load a VAE into every Ray worker's GPU, and it exists mostly so the ControlNet path can encode control images inside the workers. It's not the node you'll reach for at the end of a workflow - that's Distributed VAE (Ray), which actually decodes. This one is plumbing, and it's worth knowing exactly that.

Raylight is Komikndr's multi-GPU pack for ComfyUI. The pitch is "why buy a 5090 when you can buy two 5070s": Ray workers run one diffusion model across multiple GPUs, USP splits the sequence, FSDP splits the weights. The whole architecture is built around keeping the model - and everything it needs - resident in the Ray workers so sampling never has to shuttle data back to the ComfyUI host.

How it works

The node takes ray_actors and a vae_name (picked from your models/vae folder) and calls a ray_vae_loader remote on every worker, then returns the path as a RAY_VAE handle. If you look at the source, the docstring says it plainly: it's used by Raylight's ControlNet Apply node when the ControlNet needs a VAE, e.g. to encode the control image before processing. In most normal text-to-video workflows you never need it - you use the distributed VAE decode at the end instead.

One thing worth knowing: VAE files don't get sharded like the diffusion model does under FSDP. Each worker loads its own full copy. VAEs are small next to a 14B model, so that's fine in practice - but if you're chasing VRAM headroom on tiny cards, the VAE's few hundred MB per worker is part of your budget.

The inputs

  • ray_actors - the worker chain, from your Ray Init Actor / model loader.
  • vae_name - dropdown of VAEs in models/vae. Match it to your model's latent format (16-channel for Flux/Qwen/Wan lineage, 4-channel for SD/SDXL) or decoding produces noise or flat color, per the usual ComfyUI VAE rules.

Install

It ships with the pack, so the standard steps:

cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
<your_python> -m pip install -r requirements.txt

or search raylight in ComfyUI Manager. Restart ComfyUI and it's under the Raylight category.

Common issues

Honestly? You'll rarely touch this node directly, and that's the main gotcha - people see "Load VAE (Ray)" at the end of a workflow and swap it in for the decoder, then wonder why nothing comes out. Load VAE (Ray) loads; it outputs a RAY_VAE handle, not pixels. Decoding is RayVAEDecodeDistributed's job. If you're following a raylight example workflow, wire the outputs the way the template does - the loader feeds ControlNet Apply, the decoder feeds your preview/save nodes.

CategoryRaylight

Inputs (2)

NameTypeDefaultDescription
ray_actorsRAY_ACTORS
vae_nameCOMBO0 options:

Outputs (1)

NameTypeDescription
ray_vaeRAY_VAE