Nodes/ComfyUI-BerniniR/BerniniR · Encode Source/Reference
ComfyUI Node

BerniniR · Encode Source/Reference

The node that makes Bernini an editor, not just a generator

By neuregex·Created 3 months ago·Updated 3 months ago· 24
BerniniR · Encode Source/Reference
  • vae
  • source_video
  • reference_images
  • src

BerniniR · Encode Source/Reference is where Bernini stops being a text-to-video model and becomes the thing the community actually crowned it for: maskless video editing and reference-to-video. It takes the video you want to edit, the reference images you want to borrow identity from, and pushes both through the Wan VAE into the latent streams the sampler can attend to. No masks, no SAM, no ControlNet in front of it - that's the whole selling point of Bernini over the VACE-style pipeline.

Both its inputs are optional, and which one you feed decides what kind of generation you get:

  • source_video (IMAGE) - frames from BerniniR · Load Video (or VHS_LoadVideo). Feed this for v2v / rv2v: the model edits this clip.
  • reference_images (IMAGE) - one or more stills. Feed this for i2i / r2v / rv2v: the model borrows subject, style, or composition from them.

Feed only source_video → video editing. Only reference_images → reference-to-video. Both → video editing with a reference, the rv2v mode. Neither → this node is a no-op, and you should just be doing t2v.

How it works

Each input is VAE-encoded and stashed as latents - video frames as a video latent, each reference image as its own single-frame latent - then packed into the BR_SRC the sampler understands. The clever part happens downstream in the sampler: every stream (the target you're generating, the source video, each reference) gets its own source-id and its own phase in the RoPE grid, so the model can tell "this is the video I'm editing" apart from "this is a reference" at the same spatial position. That cross-stream separation is the mechanism behind stable edits and multi-reference consistency - the thing that made Bernini's "hold a character across camera cuts" demo land.

Because references are separate streams, prompts address them by index - "the man from image0, wearing the black T-shirt from image2, keep the bench and sunset from image4" - and the sampler's guidance mode (rv2v, v2v, r2v_apg...) decides exactly which combination of streams each forward sees.

Output

src (BR_SRC) - into the Sampler's src input. That's the only place it goes.

Install & troubleshooting

Shared pack install: ComfyUI Manager, or clone into custom_nodes + pip install -r requirements.txt. The VAE comes from BerniniR · Load VAE (Wan), which itself gets its path from Load Model.

  • Edit is ignoring the source entirely? The src output isn't connected to the sampler - a missing src silently runs as text-to-video. Check the wiring before blaming the prompt.
  • Edit is following the source but not your instruction? Crank omega_TI on the sampler, and make sure task_type on Text Encode is v2v/rv2v - not t2v.
  • Multiple references jumbling together? Number them in the prompt and be explicit about which is which; the indexed-reference style is how the model was trained to consume them.
  • Slow? Editing runs ~2× a plain generation because the source is part of the input. That's expected - plan around it, don't fight it.
CategoryBerniniR

Inputs (3)

NameTypeDefaultDescription
vaeBR_VAE
source_videooptIMAGEFrames del vídeo a editar (v2v/rv2v).
reference_imagesoptIMAGEImagen(es) de referencia (i2i/r2v/rv2v).

Outputs (1)

NameTypeDescription
srcBR_SRC