Nodes/ComfyUI-WanVideoWrapper/WanVideo UniLumos Embeds
ComfyUI Node Runs on cloud

WanVideo UniLumos Embeds

Pack a subject and a new backdrop for UniLumos-style relighting

By kijai·Created about a year ago·Updated 2 months ago· 6,651
WanVideo UniLumos Embeds
  • foreground_latents
  • background_latents
  • image_embeds
width832
height480
num_frames81

UniLumos is Alibaba DAMO Academy's relighting framework for images and video, and the best one-line description of it going around is "an intelligent green screen cutout that also grades the film" - it takes a foreground subject, drops it into a different background, and relights the subject so it actually looks like it belongs in the new scene rather than being pasted on top. Kijai wired support for it into WanVideoWrapper directly (via a commit to the repo) within days of it showing up, which is fairly typical of how fast this pack absorbs new capabilities. This node is what builds the conditioning that drives it.

How it works

You give it a foreground latent (your subject, already VAE-encoded) and a background latent (the scene you want it relit into), plus the output dimensions and frame count. The node packages those into a WANVIDIMAGE_EMBEDS bundle - the same general container type VACE and the ReCamMaster camera embed also produce - which the sampler then reads to generate a clip where the subject sits in the new background with lighting that's been adjusted to match it, rather than a flat cut-and-paste.

The inputs and output that matter

Three required, two optional:

  • width / height (defaults 832 × 480) and num_frames (default 81) - the shape of your output clip. Set these to match what you're actually generating; they're the same kind of resolution/length controls you'd set on any Wan embeds node.
  • foreground_latents (optional, LATENT) - your subject, already encoded.
  • background_latents (optional, LATENT) - the target scene, already encoded.

Both latent inputs are technically optional, but the whole point of this node is the foreground-into-background composite, so in practice you'll want both connected unless you're deliberately testing one side in isolation. Output is a single image_embeds (WANVIDIMAGE_EMBEDS) into your sampler.

How to install it

Ships with the wrapper, standard install: ComfyUI Manager → search ComfyUI-WanVideoWrapper, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt

then restart. Because UniLumos support is a recent addition, the specific model weights it needs aren't something I can point you to with confidence here - check the pack's example_workflows/ folder for a UniLumos example, which will name the exact files and where they go. Don't assume your existing Wan model files cover it; this is a distinct capability bolted onto the wrapper, not a mode of the base model.

Common issues & troubleshooting

Results only look right on easy cases. Community reaction to UniLumos on its original release was modest but genuinely positive, with a fair caveat attached: it's a specific-purpose tool, and pushing it toward extreme foreground/background mismatches (wildly different lighting, physically implausible placements) produces noticeably worse results than the clean demo shots. Expect it to do subtle relighting well and dramatic scene changes less well.

Nothing happens, or errors about missing model files. This is almost certainly a UniLumos-weight problem, not a bug in this node. Since it's a fresh integration, double-check you have the actual UniLumos-specific files installed and not just the standard Wan checkpoint - the standard wrapper install alone won't have them.

Want to sanity-check the composite before a full render? Wire the image_embeds output through WanVideoPreviewEmbeds first - it'll unpack the latent and mask so you can see roughly what's being fed to the sampler before committing to a full generation.

CategoryWanVideoWrapper

Inputs (5)

NameTypeDefaultDescription
widthINT83264–8096Width of the image to encode
heightINT48064–8096Height of the image to encode
num_framesINT811–10000Number of frames to encode
foreground_latentsoptLATENTVideo foreground latents
background_latentsoptLATENTVideo background latents

Outputs (1)

NameTypeDescription
image_embedsWANVIDIMAGE_EMBEDS