BerniniR · Sampler (src-id RoPE + APG)
The node that turns a weight download into a video
- model
- cond
- src
- latent
Everything else in this pack prepares data. This node is where the generation actually happens. BerniniR · Sampler runs ByteDance's Bernini sampling logic on top of the model the Load Model node gives you - the source-id RoPE that keeps your source video and references separate, the dual-expert switch at t=875, and the APG guidance that makes edits hold without the washed-out look of plain CFG.
It's the center of the minimal t2v graph, and it's also the node you'll spend the most time tuning:
BerniniR · Load Model ─┐
BerniniR · Load VAE ───┤
BerniniR · Text Encode ┴─► BerniniR · Sampler ─► BerniniR · VAE Decode ─► SaveAnimatedWEBP
What it's actually doing
A few details the README cares enough to call out, because they're where other ports silently drift:
- UniPC scheduler with
flow_shift = 3.0. The CLI'sflow_shift=5.0is dead code on the default UniPC path - this pack reproduces the effective behavior, which is 3.0. - Dual-expert switch by timestep value. Timestep ≥ 875 runs the high-noise expert (motion, composition); below 875 it swaps to low-noise (detail), scaling the omegas ×0.8 once on the switch. That's Wan 2.2's MoE structure, and Bernini keeps it.
- Seven guidance modes from
rv2v(4 forwards) down tot2v(2). The*_apgmodes run Adaptive Projected Guidance - the guidance diff is split into parallel/orthogonal parts, reduced per frame, with momentum carried across steps. That's the mechanism behind stable instruction edits.
The inputs that matter
guidance_mode-auto(default) derives it from the Text Encode node'stask_type: t2i/t2v →t2v, i2i/v2v →v2v, mv2v →v2v_apg, rv2v →rv2v, r2v →r2v_apg. Set it manually only if you know why you're overriding.width/height/num_frames/steps- defaults 848×480, 81 frames, 40 steps. 81 frames is the model's native context; past that you're in chunking territory. Note thatt2i/i2itasks forcenum_frames = 1automatically.omega_V(1.25),omega_I(4.5),omega_TI(4.0) - the guidance strengths for video content, image/reference content, and text respectively.omega_TIis the one you reach for when the prompt isn't landing.eta(0.5) - APG's weight on the parallel component.1.0is plain CFG; lower values let the model wander more on its own.norm_threshold(50) - clamps the guidance diff's norm (0 = no clipping). Keeps APG from blowing out on long prompts.momentum(0) - APG momentum across steps.seed- the usual.
The optional src input takes the BR_SRC output of BerniniR · Encode Source/Reference. Wire it for i2i / v2v / rv2v / r2v; leave it empty for pure t2v/t2i.
Output
latent (BR_LATENT) → BerniniR · VAE Decode. That's it - it's a BR_LATENT, not a ComfyUI latent, so feed it to this pack's decode node, not the stock VAE Decode.
Install & notes
Same as the whole pack: ComfyUI Manager or git clone + pip install -r requirements.txt (diffusers ≥ 0.35.2 is the important one). The 40 GB fp8 bundle downloads on first Load Model run.
The trap most people hit first is VRAM, not settings. Editing a 81-frame source means the source is part of the sequence - roughly double a plain Wan generation's compute. If you OOM, that's what fp8 + offload_experts and blocks_to_swap on the loader are for. If your edit ignores the source, check that you actually connected src - a silently-missing stream runs as t2v and ignores your video.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| model | BR_MODEL | — | |
| cond | BR_COND | — | |
| guidance_mode | COMBO | auto | 8 options: auto, rv2v, v2v, v2v_chain, t2v, r2v_apg, +2 |
| width | INT | 848128–2048 | — |
| height | INT | 480128–2048 | — |
| num_frames | INT | 811–257 | — |
| steps | INT | 401–100 | — |
| omega_V | FLOAT | 1.250–20 | — |
| omega_I | FLOAT | 4.500–20 | — |
| omega_TI | FLOAT | 4.000–20 | — |
| omega_scale | FLOAT | 0.800–2 | — |
| eta | FLOAT | 0.500–1 | — |
| norm_threshold | FLOAT | 500–500 | — |
| momentum | FLOAT | 0.00-1–1 | — |
| seed | INT | 420–18446744073709550000 | — |
| srcopt | BR_SRC | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | BR_LATENT | — |