Nodes/ComfyUI-BerniniR/BerniniR · Sampler (src-id RoPE + APG)
ComfyUI Node

BerniniR · Sampler (src-id RoPE + APG)

The node that turns a weight download into a video

By neuregex·Created 3 months ago·Updated 3 months ago· 24
BerniniR · Sampler (src-id RoPE + APG)
  • model
  • cond
  • src
  • latent
guidance_modeauto
width848
height480
num_frames81
steps40
omega_V1.25
omega_I4.50
omega_TI4.00
omega_scale0.80
eta0.50
norm_threshold50
momentum0.00
seed42

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's flow_shift=5.0 is 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 to t2v (2). The *_apg modes 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's task_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 that t2i/i2i tasks force num_frames = 1 automatically.
  • 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_TI is the one you reach for when the prompt isn't landing.
  • eta (0.5) - APG's weight on the parallel component. 1.0 is 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.

CategoryBerniniR

Inputs (16)

NameTypeDefaultDescription
modelBR_MODEL
condBR_COND
guidance_modeCOMBOauto8 options: auto, rv2v, v2v, v2v_chain, t2v, r2v_apg, +2
widthINT848128–2048
heightINT480128–2048
num_framesINT811–257
stepsINT401–100
omega_VFLOAT1.250–20
omega_IFLOAT4.500–20
omega_TIFLOAT4.000–20
omega_scaleFLOAT0.800–2
etaFLOAT0.500–1
norm_thresholdFLOAT500–500
momentumFLOAT0.00-1–1
seedINT420–18446744073709550000
srcoptBR_SRC

Outputs (1)

NameTypeDescription
latentBR_LATENT