Nodes/ComfyUI-BerniniR/BerniniR · Load Model (dual-expert)
ComfyUI Node

BerniniR · Load Model (dual-expert)

Your first run downloads 40GB — this loader makes that almost painless

By neuregex·Created 3 months ago·Updated 3 months ago· 24
BerniniR · Load Model (dual-expert)
    • model
    • model_path
    sourceneuregex/Bernini-R-fp8 (auto)
    auto_downloadtrue
    download_dirmodels/bernini
    dtypebf16
    fp8true
    offload_expertstrue
    model_dirBernini-R-Diffusers
    blocks_to_swap0

    This is the node that makes the whole ComfyUI-BerniniR pack one download instead of a scavenger hunt. It loads both of Bernini-R's experts (the high-noise and low-noise transformers) in one shot, auto-downloads them if they're missing, and hands you a second output that feeds the VAE and text encoder so everything shares a single source of weights. If you've read that Bernini is "2×14B and heavy," this node is the answer to "where do I even get the weights."

    Quick context if you're new to the model: Bernini-R is ByteDance's video generation + editing model, and - the finding the pack's README leads with - it is Wan2.2-T2V-A14B under the hood. Same config, same weight keys, a standard Wan VAE and UMT5 text encoder. Everything that makes it "Bernini" (the source-id RoPE, the dual-expert switch, the APG guidance) lives in the inference code, not in new parameters. So what this loader actually loads is two stock Wan experts plus the scheduler config, wrapped in a renderer that reimplements Bernini's behavior on top.

    What you actually set

    • source - defaults to neuregex/Bernini-R-fp8 (auto), the ~40 GB fp8 (e4m3) bundle that runs the full pipeline in 24 GB. The alternatives are ByteDance/Bernini-R-Diffusers (full bf16) (~126 GB; A100-class) and local if you downloaded weights yourself.
    • auto_download - on by default. First run pulls ~40 GB with a real byte progress bar (12.3% 4.95/40.30GB 47.2MB/s ETA 12.6min), not a file counter. It's resumable - Ctrl-C mid-download and the next Run picks up where it left off. There's a free-space check first.
    • fp8 - on by default. Quantizes a bf16 repo on the fly; the fp8 bundle is already quantized, so it's a no-op there. fp8 stores linear weights as e4m3 and upcasts per forward: roughly half the VRAM, slightly slower, visually indistinguishable (the README cites ~41 dB PSNR on an anchored i2i edit).
    • offload_experts - on by default. Keeps only the active expert on GPU and swaps at the t=875 boundary, mirroring what Bernini itself does. This is the difference between "fits in 24 GB" and "doesn't."
    • blocks_to_swap (optional) - streams the last N of the transformer's 40 blocks CPU↔GPU one at a time. Rule of thumb from the README: 0 for 24 GB+, 20 for ~16 GB, 30–40 for 12 GB. It only trims the weight footprint, so pair it with lower resolution if you're activation-bound.

    Outputs

    • model (BR_MODEL) - goes to BerniniR · Sampler.
    • model_path (BR_PATH) - the resolved/downloaded directory. Wire it into BerniniR · Load VAE (Wan) and BerniniR · Text Encode (UMT5 + task prefix) so those load from the same folder the loader just fetched.

    Install

    ComfyUI Manager (search "ComfyUI-BerniniR"), or:

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

    That's diffusers>=0.35.2, transformers>=4.57.0, accelerate, einops, ftfy, safetensors, sentencepiece - no pinned torch (ComfyUI provides it). The weights are the only heavy download, and this node manages them.

    Troubleshooting

    • Stuck at "Fetching N files: 5%"? Old versions (< 0.3.4) showed a file-count bar that looked frozen while a 14 GB shard streamed. Current versions show true byte progress.
    • Download crawling? The code uses HF's xet transport when hf_xet is installed, plain HTTPS otherwise. HTTPS is slower but rock-solid - the README's advice about setting HF_HUB_DISABLE_XET=1 is for older versions that enabled xet and could hang on Windows portable; current code actually suggests pip install hf_xet to speed things up.
    • OOM on a 16 GB card? fp8 + offload + blocks_to_swap=30–40 is the documented path to ~5–9 GB sampling peaks.
    • Why is editing so slow? Because the source video is part of the model input, editing runs roughly double the compute of a plain Wan generation. That's Bernini by design, not this node.

    Expect a slow first run - it's a 40 GB download plus a 14B dual-expert load. After that, the pack is genuinely the easiest way to run Bernini locally.

    CategoryBerniniR

    Inputs (8)

    NameTypeDefaultDescription
    sourceCOMBOneuregex/Bernini-R-fp8 (auto)fp8 (~40GB, cabe en 24GB) / bf16 full (~126GB) / local (usa model_dir).
    auto_downloadBOOLEANtrueDescarga el repo si falta (snapshot_download de HF).
    download_dirSTRINGmodels/berniniCarpeta de descarga (relativa a ComfyUI o absoluta).
    dtypeCOMBObf162 options: bf16, fp16
    fp8BOOLEANtrueCuantiza on-the-fly a fp8 si el repo es bf16 (el bundle fp8 ya viene cuantizado).
    offload_expertsBOOLEANtrueMantén solo el experto activo en GPU (high/low se intercambian).
    model_diroptSTRINGBernini-R-DiffusersRuta local de los pesos (solo si source='local').
    blocks_to_swapoptINT00–40N de los 40 bloques del transformer viven en CPU y se streamean a GPU por bloque (baja VRAM, más lento). 0 = off. Sube hasta caber en 16/12GB.

    Outputs (2)

    NameTypeDescription
    modelBR_MODEL
    model_pathBR_PATH