> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# ComfyUI Bernini-R Examples

> Learn how to use Bernini-R in ComfyUI for image and video editing with in-context conditioning — relighting, restyling, subject insertion, and more.

# ComfyUI Bernini-R Introduction

[Bernini-R](https://github.com/bytedance/Bernini) is ByteDance's **renderer-only** Wan 2.2 model for in-context image and video conditioning. It uses a set of conditioning streams (source video, reference images, reference video) to guide generation — no LoRA training or fine-tuning required.

Key capabilities:

* **Multiple task types in one model**: image/video generation, editing, relighting, restyling, subject insertion
* **In-context conditioning**: reference images/videos act as visual prompts, injected as tokens
* **Lightweight**: renderer-only model — no diffusion-based text-to-video backbone
* **Flexible input support**: single or multi-image references, video-to-video, reference-guided editing

Bernini-R supports these task types:

| Task      | Inputs                       | Description                                                    |
| --------- | ---------------------------- | -------------------------------------------------------------- |
| **t2v**   | Text prompt                  | Text-to-video generation                                       |
| **v2v**   | Source video                 | Video-to-video restyling                                       |
| **rv2v**  | Source video + ref images(s) | Reference-guided video editing (relighting, subject insertion) |
| **r2v**   | Reference image(s) only      | Reference-to-video generation                                  |
| **img**   | Source image + text prompt   | Image editing (relighting, restyling, subject insertion)       |
| **ads2v** | Source video + ref video     | Insert image/video content into source video                   |

<Tip>
  <Tabs>
    <Tab title="Portable or self deployed users">
      Make sure your ComfyUI is updated.

      * [Download ComfyUI](https://www.comfy.org/download)
      * [Update Guide](/installation/update_comfyui)

      Workflows in this guide can be found in the [Workflow Templates](/interface/features/template).
      If you can't find them in the template, your ComfyUI may be outdated. (Desktop version's update will delay sometime)

      If nodes are missing when loading a workflow, possible reasons:

      1. You are not using the latest ComfyUI version (Nightly version)
      2. Some nodes failed to import at startup
    </Tab>

    <Tab title="Desktop or Cloud users">
      * The Desktop is base on ComfyUI stable release, it will auto-update when there is a new Desktop stable release available.
      * [Cloud](https://cloud.comfy.org) will update after ComfyUI stable release.

      So, if you find any core node missing in this document, it might be because the new core nodes have not yet been released in the latest stable version. Please wait for the next stable release.
    </Tab>
  </Tabs>
</Tip>

<Tip>
  ComfyUI now natively supports Bernini-R nodes. Make sure you have updated to the latest version of [ComfyUI](https://github.com/Comfy-Org/ComfyUI) before starting.
</Tip>

## Model Installation

Download the required model weights and save them to the corresponding ComfyUI folders:

**text\_encoders:**

* [umt5\_xxl\_fp8\_e4m3fn\_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors?download=true)

**vae:**

* [Wan2\_1\_VAE\_bf16.safetensors](https://huggingface.co/Kijai/WanVideo_comfy/resolve/main/Wan2_1_VAE_bf16.safetensors?download=true)

**loras:**

* [lightx2v\_T2V\_14B\_cfg\_step\_distill\_v2\_lora\_rank64\_bf16.safetensors](https://huggingface.co/Kijai/WanVideo_comfy/resolve/main/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank64_bf16.safetensors?download=true)

**diffusion\_models:**

* [wan2.2\_bernini\_r\_fp16.safetensors](https://huggingface.co/Comfy-Org/Bernini-R/resolve/main/wan2.2_bernini_r_fp16.safetensors)

```
ComfyUI/
├── models/
│   ├── text_encoders/
│   │   └── umt5_xxl_fp8_e4m3fn_scaled.safetensors
│   ├── vae/
│   │   └── Wan2_1_VAE_bf16.safetensors
│   ├── loras/
│   │   └── lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank64_bf16.safetensors
│   ├── diffusion_models/
│   │   └── wan2.2_bernini_r_fp16.safetensors
```

## Example Workflows

***

## 1. Image Editing

**What it does:** Generate an edited image with matched lighting and view a side-by-side before/after comparison. Ideal for portrait and product relighting, consistent lighting across photo sets, and e-commerce catalog photography.

<CardGroup cols={2}>
  <Card title="Download Workflow" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/video_bernini_r_image_editing.json">
    Download JSON or search "Bernini-R" in Template Library
  </Card>

  <Card title="Run on Comfy Cloud" icon="cloud" href="https://cloud.comfy.org/?template=video_bernini_r_image_editing&utm_source=docs&utm_medium=referral&utm_campaign=bernini-r">
    Open in Comfy Cloud
  </Card>
</CardGroup>

<div style={{display: 'flex', gap: '1rem', flexWrap: 'wrap'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/video_bernini_r_image_editing-1.webp" alt="Bernini-R Image Editing output" style={{maxWidth: '48%', height: 'auto'}} />

  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/video_bernini_r_image_editing-2.webp" alt="Bernini-R Image Editing comparison" style={{maxWidth: '48%', height: 'auto'}} />
</div>

### Steps to Run

1. **Select Task Type** — choose your task (Image Editing, Subject to Image, etc.)
2. **Connect Inputs** — load source image and optional reference images
3. **Write Prompt** — describe the desired edit
4. **Run** — click Queue or use `Cmd+Enter`

**Reference Image input:** Use for **Subject to Image** when you need one or more reference images (subject, outfit, scene, props). In the prompt, use `image0`, `image1`, … to reference each image. Not needed for **Image Editing** — that task uses `source_image` instead.

<Card title="Learn about Subgraph" icon="book-open" href="/interface/features/subgraph">
  This workflow uses Subgraph nodes for modular processing. Check out the Subgraph documentation to learn how to customize and extend the workflow.
</Card>

***

## 2. Video Editing

**What it does:** Generate an edited video with consistent relighting using Bernini-R. Connect a source video, optional reference image(s) or reference video, pick the task type, write a prompt, and run.

<CardGroup cols={2}>
  <Card title="Download Workflow" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/video_bernini_r_video_editing.json">
    Download JSON or search "Bernini-R" in Template Library
  </Card>

  <Card title="Run on Comfy Cloud" icon="cloud" href="https://cloud.comfy.org/?template=video_bernini_r_video_editing&utm_source=docs&utm_medium=referral&utm_campaign=bernini-r">
    Open in Comfy Cloud
  </Card>
</CardGroup>

![Bernini-R Video Editing preview](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/video_bernini_r_video_editing-1.webp)

### Steps to Run

1. **Load Source Video** — connect your input video
2. **(Optional) Load References** — reference image(s) or reference video
3. **Select Task Type** — v2v, rv2v, r2v, or ads2v
4. **Write Prompt** — describe the desired edit
5. **Run** — click Queue or use `Cmd+Enter`

**Reference Image input:** Use when a task needs one or more reference images (rv2v, r2v, multi-piece outfits). Each batched image becomes its own in-context token. Mention `image0`, `image1`, … in the prompt if references play different roles.

<Card title="Learn about Subgraph" icon="book-open" href="/interface/features/subgraph">
  This workflow uses Subgraph nodes for modular processing. Check out the Subgraph documentation to learn how to customize and extend the workflow.
</Card>

***

## Community Resources

* [Bernini GitHub (bytedance/Bernini)](https://github.com/bytedance/Bernini) — Research paper and task documentation
* [Comfy-Org/Bernini-R](https://huggingface.co/Comfy-Org/Bernini-R) — Official ComfyUI model weights
* [Bernini: Latent Semantic Planning for Video Diffusion](https://arxiv.org/abs/2605.22344) — Research paper
