Nodes/lzits Nodes/Bernini Conditioning (Kijai Branch)
ComfyUI Node

Bernini Conditioning (Kijai Branch)

The Bernini conditioning node that does nothing on mainline ComfyUI (on purpose)

By lzitser23·Created 9 months ago·Updated 3 months ago· 0
Bernini Conditioning (Kijai Branch)
  • positive
  • negative
  • vae
  • source_video
  • reference_video
  • reference_images
  • positive
  • negative
  • latent
width832
height480
length81
batch_size1
ref_max_size848

Most nodes in this pack are safe to add to any graph. This one carries a big asterisk: Bernini Conditioning only changes model behavior if your ComfyUI build understands a conditioning key called context_latents - namely Kijai's ComfyUI/tree/bernini branch, or a future upstream equivalent. On ordinary mainline ComfyUI it sits in your graph as a well-behaved passthrough and the core Wan model simply ignores the extra conditioning it adds. That's not a bug; it's compatibility scaffolding for a specific way of running Bernini.

What it does when it works

It's the native-conditioning bridge for people running Bernini the "Kijai branch" way, where source and reference media travel through the graph as tensors rather than as file paths in a case JSON. The node:

  1. Encodes your media through the VAE.
  2. Appends those latents to both positive and negative conditioning under the context_latents key.
  3. Returns a zero latent shaped for Wan/Bernini at your requested width/height/length/batch_size - the sampler fills it with noise and denoises from there, so the zeros are expected, not a bug.

Inputs

  • positive / negative (CONDITIONING) - your text conditioning, which comes back with context latents attached.
  • vae - the Wan VAE used to encode media.
  • width / height / length / batch_size - latent geometry. length defaults to 81 (Wan's native window), stepping by 4.
  • source_video (IMAGE) - base/edit frames for v2v/rv2v; resized to width×height and trimmed to length.
  • reference_video (IMAGE) - moving reference content; keeps native aspect, long edge capped by ref_max_size.
  • reference_images (IMAGE) - each image encoded as its own native-aspect context stream (the multi-reference mode).
  • ref_max_size - long-edge cap for reference media, default 848.

Outputs

positive, negative (CONDITIONING) - with context_latents set when media was supplied. latent (LATENT) - the zero tensor for the sampler.

The practical question: which path are you on?

This pack's default recommended graph (Setup Commands → Model Config + Case Builder + Generation Settings → Run Single GPU) doesn't use this node at all - it passes media as file paths in the case JSON and lets the upstream script do the encoding. LzitsBerniniConditioning is the alternative branch for a ComfyUI-native graph, and only worth wiring if you're deliberately on Kijai's bernini branch. If you're on stock ComfyUI and wondering why your source video is having no effect, that's the answer.

Installing this node

One of the 16 nodes in the lzits Nodes pack (Lior Zitser, MIT). Install via ComfyUI Manager (search "lzits Nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/lzitser23/lzits-nodes.git

Restart ComfyUI. No extra dependencies beyond ComfyUI's own (torch, VAE encode path).

Categorylzits nodes/Bernini

Inputs (11)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
widthINT83216–8192
heightINT48016–8192
lengthINT811–8192
batch_sizeINT11–4096
source_videooptIMAGEBase/edit video frames for v2v/rv2v. Resized to width x height and trimmed to length.
reference_videooptIMAGEMoving/content reference frames. Native aspect, long edge capped by ref_max_size.
reference_imagesoptIMAGEReference image batch. Each image is encoded as its own native-aspect context stream.
ref_max_sizeoptINT84816–8192

Outputs (3)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT