> ## 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.

# Bria Eraser, Expand Image, and GenFill in ComfyUI

> Remove objects, expand images, and generate content inside masked regions with the Bria Eraser, Expand Image, and Generative Fill partner nodes in ComfyUI.

Bria's image editing tools are available in ComfyUI as Partner Nodes. This page covers three mask-based editing workflows: **Bria Eraser** (remove objects), **Bria Expand Image** (outpaint beyond the borders), and **Bria Generative Fill** (generate content inside a masked region). All three keep everything outside the edited area pixel-perfect unchanged.

Each workflow takes a single input image plus a mask. The **Painter** node in the templates provides a brush canvas for drawing the mask, and an **ImageCompare** node shows the before/after result side by side. The Painter node is only available under Nodes 2.0; if you only see "Painter: Node 2.0 only", enable Nodes 2.0 via **Menu -> Nodes2.0**, or use the [Mask Editor](https://docs.comfy.org/interface/maskeditor) to create the mask instead.

<Tip>
  To use the Partner Nodes, you need to ensure that you are logged in properly and using a permitted network environment. Please refer to the [Partner Nodes Overview](/tutorials/partner-nodes/overview) section of the documentation to understand the specific requirements for using the Partner Nodes.
</Tip>

<Tip>
  <Tabs>
    <Tab title="Local 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.

      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="Cloud users">
      * [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>

<h3 id="api_bria_eraser">
  Bria: Eraser
</h3>

Remove a specific object or region from an image. The masked area is erased and filled with surrounding context; everything outside the mask stays unchanged.

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_bria_eraser-1.webp" alt="Bria: Eraser workflow preview" />

<CardGroup cols={2}>
  <Card title="Run on Comfy Cloud" icon="cloud" href="https://cloud.comfy.org/?template=api_bria_eraser&utm_source=docs&utm_medium=referral&utm_campaign=bria-image-editing">
    Open in Comfy Cloud
  </Card>

  <Card title="Download Workflow" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_bria_eraser.json">
    Download JSON or search "Bria Eraser" in Template Library
  </Card>
</CardGroup>

**Input materials**

Upload this file to the matching `LoadImage` node:

<CardGroup cols={1}>
  <Card title="vintage_girl_yellow_apple.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/vintage_girl_yellow_apple.png">
    Download sample input image
  </Card>
</CardGroup>

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/vintage_girl_yellow_apple.png" alt="Bria: Eraser input" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />

  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/Bria_Eraser.png" alt="Bria: Eraser example output" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />
</div>

**How to use**

1. **Load an image**: Upload your image in `LoadImage`. The Painter canvas and compare view auto-update.
2. **Paint a mask**: Brush over the object or region you want to remove. Paint slightly beyond the object's edge (hair, glass, fabric, contact points) so the model has room to blend cleanly.
3. **Run `BriaEraser`**: No prompt needed. The node erases the masked area and inpaints the background. Enter your `api_key` if it is not already set.
4. **Compare and save**: `ImageCompare` shows before/after, `SaveImageAdvanced` exports the result.

<Note>
  The masked area is fully regenerated from its surroundings, so the result blends seamlessly. The mask is binary: white (255) marks the region to erase, black (0) everywhere else, and it must match the image's aspect ratio. For more precise results, use an automatic segmentation mask (SAM-style) if available: the API's `mask_type` distinguishes `manual` (brush-drawn) from `automatic` (algorithm-generated) masks.
</Note>

<h3 id="api_bria_expand_image">
  Bria: Expand Image
</h3>

Expand an image beyond its original borders. The original image stays untouched; the surrounding area is generated to match its lighting, perspective, and texture.

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_bria_expand_image-1.webp" alt="Bria: Expand Image workflow preview" />

<CardGroup cols={2}>
  <Card title="Run on Comfy Cloud" icon="cloud" href="https://cloud.comfy.org/?template=api_bria_expand_image&utm_source=docs&utm_medium=referral&utm_campaign=bria-image-editing">
    Open in Comfy Cloud
  </Card>

  <Card title="Download Workflow" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_bria_expand_image.json">
    Download JSON or search "Bria Expand Image" in Template Library
  </Card>
</CardGroup>

**Input materials**

Upload this file to the matching `LoadImage` node:

<CardGroup cols={1}>
  <Card title="red_sports_car_night.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/red_sports_car_night.png">
    Download sample input image
  </Card>
</CardGroup>

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/red_sports_car_night.png" alt="Bria: Expand Image input" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />

  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/Bria_Expand_Image.png" alt="Bria: Expand Image example output" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />
</div>

**How to use**

1. **Load an image**: Upload your image in `LoadImage` and connect it to `BriaExpandImage`.
2. **Choose an expansion mode** in the `expand_mode` dropdown:
   * **Preset aspect ratio**: Pick one of `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`. The image is centered and the edges are expanded to fit that ratio.
   * **Custom ratio**: Pick `custom_ratio` and set `ratio_width` / `ratio_height` (e.g. 21 and 9 for 21:9). Bria accepts width-to-height ratios between 0.5 and 3.0, so anything taller than 1:2 needs the manual mode.
   * **Manual**: Pick `manual` and place the original image on a canvas with `canvas_width` / `canvas_height` (max 5000 x 5000), `image_width` / `image_height`, and `image_x` / `image_y` (the image's top-left corner; can be negative to crop).
3. **Prompt (optional)**: Leave it empty and Bria automatically generates a prompt from the input image and expands to match its scene and style. Or write your own to guide the expansion direction explicitly, for example "the street continuing to the right", "add a streetlamp", "no other cars". English only; special characters are not supported.
4. **Optional**: `negative_prompt` to avoid unwanted content, `seed` to reproduce a result, `moderation` to enable content moderation.
5. **Save**: Connect the image output to `SaveImage`.

<Note>
  The `prompt` output on the node shows the prompt actually used: your input, or the one auto-generated by Bria when the field is empty. If the target aspect ratio equals the image's current ratio (e.g. a 1:1 image set to `1:1`), no changes are made and the image is returned as-is. Canvas area is limited to 5,000 x 5,000 pixels. Keep the main subject above 15% of the total canvas area for best results.
</Note>

<h3 id="api_bria_genfill">
  Bria: Generative Fill
</h3>

Regenerate a specific region of an image from a prompt. The masked area is fully regenerated; everything outside the mask stays pixel-perfect unchanged.

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_bria_genfill-1.webp" alt="Bria: Generative Fill workflow preview" />

<CardGroup cols={2}>
  <Card title="Run on Comfy Cloud" icon="cloud" href="https://cloud.comfy.org/?template=api_bria_genfill&utm_source=docs&utm_medium=referral&utm_campaign=bria-image-editing">
    Open in Comfy Cloud
  </Card>

  <Card title="Download Workflow" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_bria_genfill.json">
    Download JSON or search "Bria: Generative Fill" in Template Library
  </Card>
</CardGroup>

**Input materials**

Upload this file to the matching `LoadImage` node:

<CardGroup cols={1}>
  <Card title="retro_girl_cinnamon_bun.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/retro_girl_cinnamon_bun.png">
    Download sample input image
  </Card>
</CardGroup>

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/retro_girl_cinnamon_bun.png" alt="Bria: Generative Fill input" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />

  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/Bria_GenFill.png" alt="Bria: Generative Fill example output" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />
</div>

**How to use**

1. **Load an image**: Upload your image in `LoadImage`. The Painter canvas and compare view auto-update.
2. **Paint a mask**: Brush over the region you want to regenerate. Blob-shaped, brush-drawn masks work best. Paint slightly beyond the object's edge (hair, glass, fabric, contact points) so the model has room to blend.
3. **Write the prompt**: In `BriaGenFill`, describe what should be generated inside the masked area, as if art-directing a cropped micro-scene: name the object, its material and size, how it interacts with the surface, and ask for a contact shadow. Around 90-110 words works best. Keep `refine_prompt` enabled.
4. **Optional**: `negative_prompt` to avoid unwanted details. Use a fixed `seed` to iterate on the mask or wording, then randomize once the result looks right.
5. **Compare and save**: `ImageCompare` shows before/after, `SaveImageAdvanced` exports the result.

<Note>
  Masks trigger generative replacement, not pixel retouching: the masked area means "regenerate this region", not "touch up this region".
</Note>

## Get started

1. Update ComfyUI to the latest version
2. Go to Template Library, search for `Bria Eraser`, `Bria Expand Image`, or `Bria Generative Fill`
