Nodes/ComfyUI-BerniniR Wrapper/Bernini-R Model Loader
ComfyUI Node

Bernini-R Model Loader

The lazy loader that stops Bernini-R from eating your VRAM before it runs

By xiaolibai-sys·Created 2 months ago·Updated 2 months ago· 9
Bernini-R Model Loader
  • attn_backend_args
  • model_handle
model_name

Bernini-R is ByteDance's renderer-only video generation and editing model, fine-tuned from Wan 2.1/2.2 weights. It's great at what it does - instruction-driven editing with no mask, no ControlNet, no SAM in front of it. It's also heavy: because the source video you're editing becomes part of the model input, an edit costs roughly twice the compute of the equivalent Wan 2.2 generation. That's exactly why this node exists. BerniniR_ModelLoader doesn't load the model. It hands you a lightweight handle, and the actual weights stay on disk until the sampler needs them.

How it works

The old way of doing things loads weights into RAM the moment the loader node executes, where they sit hogging VRAM while you wire up the rest of your graph. This pack flips that. The loader resolves your checkpoint path and creates a BERNINI_MODEL_HANDLE - a small object, not the weights. When the sampler finally runs, it calls handle.load(), moves weights to GPU at that point, and an LRU cache in the handle layer means repeated runs don't re-read the same file off disk. It's the same lazy-loading trick that lets the pack layer context windows, block swap, and VAE chunking into one coherent VRAM strategy: nothing sits in memory until it's actually being used.

The inputs that matter

This is one of the simpler nodes in the pack, and that's fine. The single required input is:

  • model_name - your Bernini-R checkpoint as a .safetensors file in ComfyUI/models/diffusion_models/. The dropdown lists whatever's in there. Both the 1.3B and 14B checkpoints load through this same node; pick the one that matches your VRAM and quality budget.

One optional input, worth understanding:

  • attn_backend_args - the BERNINI_ATTN output from BerniniR_AttentionConfig. If you connect it, the chosen attention backend (SageAttention, FlashAttention, xformers, SDPA…) is stored on the handle and applied when the model actually loads. If you skip it, the pack falls back to auto-detection, which is honestly fine for a first run.

What comes out

One output: model_handle (BERNINI_MODEL_HANDLE). This is the currency of the whole pack. It feeds BerniniR_LoadLoRA, BerniniR_CompileModel, and then either BerniniR_KSampler or BerniniR_DualExpertSampler. You can chain LoRA and compile nodes in any order between the loader and the sampler - they just keep stamping config onto the same handle.

Installing the model

The pack itself installs the normal way (ComfyUI Manager, search "ComfyUI-BerniniR Wrapper", or clone into custom_nodes). The model is the real download. You want a ComfyUI-compatible conversion of the ByteDance/Bernini-R-1.3B-Diffusers (or 14B) weights sitting in diffusion_models/, plus the Wan T5-XXL text encoder in text_encoders/ and the Wan 16-channel VAE in vae/. Standard Wan files, standard folders.

One honest caveat from the author's own README: standard Wan/Wan 2.1 diffusion models may load through this node, but they weren't tested. Don't count on this pack as a generic Wan loader - it's a Bernini-R wrapper.

Where people get burned

If your model name is missing from the dropdown, it's almost always a refresh or a wrong-folder problem - the file must be in diffusion_models/, not somewhere you pointed ComfyUI at. And if you're on a 12GB or 16GB card trying the 14B checkpoint, don't just crank everything and pray: connect a BerniniR_ContextWindow and BerniniR_BlockSwapArgs to the sampler. The lazy handle saves you nothing if the sampler then tries to fit the whole 14B model plus your edited video in VRAM at once.

CategoryBernini-R/Loaders

Inputs (2)

NameTypeDefaultDescription
model_nameCOMBOBernini-R model checkpoint (.safetensors)
attn_backend_argsoptBERNINI_ATTNAttention backend config (SageAttn3 → FlashAttn → xformers → SDPA)

Outputs (1)

NameTypeDescription
model_handleBERNINI_MODEL_HANDLE