Extensions/ComfyUI-FL-BerniniR
ComfyUI Extension

ComfyUI-FL-BerniniR

Bernini-R omni video generation nodes for ComfyUI

By filliptm·Created 3 months ago·Updated 3 months ago· 0
filliptm/ComfyUI-FL-BerniniR
Nodes4
On cloudLocal install
CategoryFL/BerniniR
Stars0
Updated3 months ago
Readme

FL Bernini-R

Omni video generation nodes for ComfyUI powered by ByteDance's Bernini-R model. The pack runs the official Bernini source in-process inside the ComfyUI Python environment and exposes a compact loader/generate workflow with modality-aware controls, live node progress, image preview output, and saved image/video files.

Bernini-R Original Repo Patreon

Features

  • Standalone node pack - Installs as ComfyUI-FL-BerniniR without depending on another FL pack.
  • ComfyUI-native runtime - Uses the active ComfyUI Python environment and model folders.
  • Modality-aware generation - One generate node supports Bernini-R text, image, video, reference, and ads-style task modes.
  • Model loader cache - Load Bernini-R once and reuse it across prompts, with a dedicated unload node and unload_after_run option.
  • Live visibility - Sends structured progress events to the ComfyUI frontend and displays the current stage on the node.
  • Image and video outputs - Returns an image preview plus output path, final prompt, and debug JSON.
  • Comfy-safe attention fallback - Defaults to PyTorch SDPA to avoid incompatible FlashAttention bindings in mixed Comfy environments.

Nodes

| Node | Description | |------|-------------| | FL Bernini-R Environment Check | Reports Python, CUDA, GPU, dependency, and Bernini import status. | | FL Bernini-R Loader | Loads ByteDance/Bernini-R-Diffusers from the ComfyUI model folder or an override path. | | FL Bernini-R Generate | Runs Bernini-R generation for image/video modalities with prompt, resolution, frame, guidance, and seed controls. | | FL Bernini-R Unload | Clears the cached Bernini-R pipeline and releases memory. |

Installation

ComfyUI Manager

Search for ComfyUI-FL-BerniniR and install.

Manual

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

Restart ComfyUI after installation.

Model Setup

The default model path is:

ComfyUI/models/BerniniR/Bernini-R-Diffusers

Recommended model:

ByteDance/Bernini-R-Diffusers

The model is very large, roughly 117 GB. For first setup, either place the Hugging Face snapshot at the default path or enable download_if_missing on FL Bernini-R Loader. A large system RAM and VRAM budget is expected.

Quick Start

Text to Image

  1. Add FL Bernini-R Loader.
  2. Add FL Bernini-R Generate and connect the loader output to pipeline.
  3. Set task_type to t2i.
  4. Set num_frames to 1.
  5. Start with a small resolution and low step count for the first smoke test.
  6. Queue the prompt and watch the node progress widget for the current stage.

Text to Video

  1. Use the same loader/generate connection.
  2. Set task_type to t2v.
  3. Set num_frames, fps, width, and height.
  4. Leave output_format on auto to save MP4.
  5. Use FL Bernini-R Unload or unload_after_run when finished to reclaim memory.

Image or Video Conditioned Modes

Connect a ComfyUI image batch to image for image-conditioned tasks, connect reference_images for reference modes, or provide video_path for video-conditioned tasks.

Modes

| Mode | Inputs | Output | Notes | |------|--------|--------|-------| | t2i | Prompt | PNG | Text-to-image smoke path. | | i2i | Prompt + image | PNG | Image-conditioned image generation. | | t2v | Prompt | MP4 | Text-to-video generation. | | v2v | Prompt + video_path | MP4 | Video-conditioned generation. | | mv2v | Prompt + video_path | MP4 | Multi-view/video-conditioned mode from Bernini. | | r2v | Prompt + reference_images | MP4 | Reference-image to video. | | rv2v | Prompt + video_path + reference_images | MP4 | Reference plus video-conditioned generation. | | ads2v | Prompt + references/video as needed | MP4 | Ads-oriented Bernini mode. |

Key Parameters

  • width / height - Output dimensions. Bernini-R is heavy; test smaller sizes before long renders.
  • num_frames - Number of output frames for video modes. Image modes force one frame.
  • num_inference_steps - Diffusion step count. Higher usually improves quality and increases runtime.
  • guidance_mode - Use auto for task-aware defaults or choose a Bernini guidance mode directly.
  • max_image_size - Caps conditioning image size before Bernini receives it.
  • seed - Set -1 for random seed.
  • unload_after_run - Clears the model cache after generation to reclaim memory.

Attention Backend

This pack defaults Bernini-R attention to PyTorch SDPA because some ComfyUI environments have FlashAttention 3 packages with incompatible custom-op signatures. Advanced users can opt into FlashAttention by setting:

set FL_BERNINI_ATTENTION_BACKEND=auto

Supported values are sdpa, auto, fa3, and fa2.

Requirements

  • Python 3.10+
  • NVIDIA GPU strongly recommended
  • Large disk space for the model snapshot, roughly 117 GB
  • High system RAM and VRAM; Bernini-R is substantially heavier than typical ComfyUI image nodes
  • ComfyUI with recent torch, diffusers, transformers, accelerate, decord, and imageio

Validation

This pack has been smoke-tested in ComfyUI with:

  • Node registration through /object_info
  • Environment check prompt
  • t2i generation at 128x128, one frame, one inference step

Credits

Based on ByteDance's Bernini project and ByteDance/Bernini-R-Diffusers model release.

License

Apache-2.0. See ByteDance/Bernini for the upstream project license and model terms.