briaai / BRIA-2.3-ControlNet-Generative-Fill

huggingface.co
Total runs: 4
24-hour runs: 0
7-day runs: 4
30-day runs: 4
Model's Last Updated: July 06 2025
text-to-image

Introduction of BRIA-2.3-ControlNet-Generative-Fill

Model Details of BRIA-2.3-ControlNet-Generative-Fill

BRIA 2.3 ControlNet Generative Fill Fast

Trained exclusively on the largest multi-source commercial-grade licensed dataset, BRIA 2.3 Generative Fill guarantees best quality while safe for commercial use. The model provides full legal liability coverage for copyright and privacy infrigement and harmful content mitigation, as our dataset does not represent copyrighted materials, such as fictional characters, logos or trademarks, public figures, harmful content or privacy infringing content.

BRIA 2.3 Generative Fill is a model designed to fill masked regions in images based on user-provided textual prompts. The model can be applied in different scenarios, including object, replacement, addition, and modification within an image.

This model works with all types of masks, but is highly optimized to work best with blob-shaped masks which occupy more than 15% of the image area.

Join our Discord community for more information, tutorials, tools, and to connect with other users!

What's New

BRIA 2.3 ControlNet Generative Fill can be applied on top of BRIA 2.3 Text-to-Image and therefore enable to use Fast-LORA . This results in extremely fast generative fill model, requires only 1.6s using A10 GPU.

Model Description
  • Developed by: BRIA AI
  • Model type: Latent diffusion image-to-image model
  • License: bria-2.3 inpainting Licensing terms & conditions .
  • Purchase is required to license and access the model.
  • Model Description: BRIA 2.3 Generative Fill was trained exclusively on a professional-grade, licensed dataset. It is designed for commercial use and includes full legal liability coverage.
  • Resources for more information: BRIA AI
Get Access to the source code and pre-trained model

Interested in BRIA 2.3 Generative Fill? Our Model is available for purchase.

Purchasing access to BRIA 2.3 Generative Fill ensures royalty management and full liability for commercial use.

Are you a startup or a student? We encourage you to apply for our specialized Academia and Startup Programs to gain access. These programs are designed to support emerging businesses and academic pursuits with our cutting-edge technology.

Contact us today to unlock the potential of BRIA 2.3 Generative Fill!

By submitting the form above, you agree to BRIA’s Privacy policy and Terms & conditions .

How To Use
from diffusers import (
    AutoencoderKL,
    LCMScheduler,
)
from pipeline_controlnet_sd_xl import StableDiffusionXLControlNetPipeline
from controlnet import ControlNetModel, ControlNetConditioningEmbedding
import torch
import numpy as np
from PIL import Image
import requests
import PIL
from io import BytesIO
from torchvision import transforms
import pandas as pd 
import os 


def resize_image_to_retain_ratio(image):
    pixel_number = 1024*1024
    granularity_val = 8
    ratio = image.size[0] / image.size[1]
    width = int((pixel_number * ratio) ** 0.5)
    width = width - (width % granularity_val)
    height = int(pixel_number / width)
    height = height - (height % granularity_val)

    image = image.resize((width, height))
    return image


def download_image(url):
    response = requests.get(url)
    return PIL.Image.open(BytesIO(response.content)).convert("RGB")


def get_masked_image(image, image_mask, width, height):
    image_mask = image_mask # fill area is white
    image_mask = image_mask.resize((width, height)) # object to remove is white (1)
    image_mask_pil = image_mask
    image = np.array(image.convert("RGB")).astype(np.float32) / 255.0
    image_mask = np.array(image_mask_pil.convert("L")).astype(np.float32) / 255.0
    assert image.shape[0:1] == image_mask.shape[0:1], "image and image_mask must have the same image size"
    masked_image_to_present = image.copy()
    masked_image_to_present[image_mask > 0.5] = (0.5,0.5,0.5)  # set as masked pixel
    image[image_mask > 0.5] = 0.5  # set as masked pixel - s.t. will be grey 
    image = Image.fromarray((image * 255.0).astype(np.uint8))
    masked_image_to_present = Image.fromarray((masked_image_to_present * 255.0).astype(np.uint8))
    return image, image_mask_pil, masked_image_to_present


image_transforms = transforms.Compose(
    [
        transforms.ToTensor(),
    ]
)

default_negative_prompt = "blurry"

img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"

init_image = download_image(img_url).resize((1024, 1024))
mask_image = download_image(mask_url).resize((1024, 1024))


init_image = resize_image_to_retain_ratio(init_image)
width, height = init_image.size

mask_image = mask_image.convert("L").resize(init_image.size)

width, height = init_image.size

# Load, init model    
controlnet = ControlNetModel().from_pretrained("briaai/BRIA-2.3-ControlNet-Generative-Fill", torch_dtype=torch.float16)
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = StableDiffusionXLControlNetPipeline.from_pretrained("briaai/BRIA-2.3", controlnet=controlnet.to(dtype=torch.float16), torch_dtype=torch.float16, vae=vae) #force_zeros_for_empty_prompt=False, # vae=vae)

pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights("briaai/BRIA-2.3-FAST-LORA")
pipe.fuse_lora()
pipe = pipe.to(device="cuda")

# pipe.enable_xformers_memory_efficient_attention()

generator = torch.Generator(device="cuda").manual_seed(123456)

vae = pipe.vae


masked_image, image_mask, masked_image_to_present = get_masked_image(init_image, mask_image, width, height)

masked_image_tensor = image_transforms(masked_image)
masked_image_tensor = (masked_image_tensor - 0.5) / 0.5


masked_image_tensor = masked_image_tensor.unsqueeze(0).to(device="cuda")
control_latents = vae.encode(  
        masked_image_tensor[:, :3, :, :].to(vae.dtype)
    ).latent_dist.sample()   
control_latents = control_latents * vae.config.scaling_factor 


image_mask = np.array(image_mask)[:,:]
mask_tensor = torch.tensor(image_mask, dtype=torch.float32)[None, ...]
# binarize the mask
mask_tensor = torch.where(mask_tensor > 128.0, 255.0, 0)       

mask_tensor = mask_tensor / 255.0

mask_tensor = mask_tensor.to(device="cuda")
mask_resized = torch.nn.functional.interpolate(mask_tensor[None, ...], size=(control_latents.shape[2], control_latents.shape[3]), mode='nearest')

masked_image = torch.cat([control_latents, mask_resized], dim=1)

prompt = ""

gen_img = pipe(negative_prompt=default_negative_prompt, prompt=prompt, 
            controlnet_conditioning_scale=1.0, 
            num_inference_steps=12, 
            height=height, width=width, 
            image = masked_image, # control image
            init_image = init_image,     
            mask_image = mask_tensor,
            guidance_scale = 1.2,
            generator=generator).images[0]

Runs of briaai BRIA-2.3-ControlNet-Generative-Fill on huggingface.co

4
Total runs
0
24-hour runs
4
3-day runs
4
7-day runs
4
30-day runs

More Information About BRIA-2.3-ControlNet-Generative-Fill huggingface.co Model

More BRIA-2.3-ControlNet-Generative-Fill license Visit here:

https://choosealicense.com/licenses/bria-2.3

BRIA-2.3-ControlNet-Generative-Fill huggingface.co

BRIA-2.3-ControlNet-Generative-Fill huggingface.co is an AI model on huggingface.co that provides BRIA-2.3-ControlNet-Generative-Fill's model effect (), which can be used instantly with this briaai BRIA-2.3-ControlNet-Generative-Fill model. huggingface.co supports a free trial of the BRIA-2.3-ControlNet-Generative-Fill model, and also provides paid use of the BRIA-2.3-ControlNet-Generative-Fill. Support call BRIA-2.3-ControlNet-Generative-Fill model through api, including Node.js, Python, http.

BRIA-2.3-ControlNet-Generative-Fill huggingface.co Url

https://huggingface.co/briaai/BRIA-2.3-ControlNet-Generative-Fill

briaai BRIA-2.3-ControlNet-Generative-Fill online free

BRIA-2.3-ControlNet-Generative-Fill huggingface.co is an online trial and call api platform, which integrates BRIA-2.3-ControlNet-Generative-Fill's modeling effects, including api services, and provides a free online trial of BRIA-2.3-ControlNet-Generative-Fill, you can try BRIA-2.3-ControlNet-Generative-Fill online for free by clicking the link below.

briaai BRIA-2.3-ControlNet-Generative-Fill online free url in huggingface.co:

https://huggingface.co/briaai/BRIA-2.3-ControlNet-Generative-Fill

BRIA-2.3-ControlNet-Generative-Fill install

BRIA-2.3-ControlNet-Generative-Fill is an open source model from GitHub that offers a free installation service, and any user can find BRIA-2.3-ControlNet-Generative-Fill on GitHub to install. At the same time, huggingface.co provides the effect of BRIA-2.3-ControlNet-Generative-Fill install, users can directly use BRIA-2.3-ControlNet-Generative-Fill installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

BRIA-2.3-ControlNet-Generative-Fill install url in huggingface.co:

https://huggingface.co/briaai/BRIA-2.3-ControlNet-Generative-Fill

Url of BRIA-2.3-ControlNet-Generative-Fill

BRIA-2.3-ControlNet-Generative-Fill huggingface.co Url

Provider of BRIA-2.3-ControlNet-Generative-Fill huggingface.co

briaai
ORGANIZATIONS

Other API from briaai

huggingface.co

Total runs: 384.5K
Run Growth: -237.5K
Growth Rate: -61.76%
Updated:April 06 2026
huggingface.co

Total runs: 257.9K
Run Growth: -90.6K
Growth Rate: -35.11%
Updated:July 06 2025
huggingface.co

Total runs: 2.8K
Run Growth: -1.4K
Growth Rate: -51.31%
Updated:October 29 2025
huggingface.co

Total runs: 734
Run Growth: -244
Growth Rate: -33.24%
Updated:July 05 2026
huggingface.co

Total runs: 548
Run Growth: -544
Growth Rate: -99.27%
Updated:August 18 2026
huggingface.co

Total runs: 479
Run Growth: -583
Growth Rate: -121.71%
Updated:September 09 2026
huggingface.co

Total runs: 243
Run Growth: -381
Growth Rate: -156.79%
Updated:January 30 2026
huggingface.co

Total runs: 235
Run Growth: 0
Growth Rate: 0.00%
Updated:May 12 2024
huggingface.co

Total runs: 214
Run Growth: 127
Growth Rate: 59.35%
Updated:September 05 2026
huggingface.co

Total runs: 135
Run Growth: 85
Growth Rate: 62.96%
Updated:September 01 2025
huggingface.co

Total runs: 131
Run Growth: 0
Growth Rate: 0.00%
Updated:August 04 2024
huggingface.co

Total runs: 104
Run Growth: 39
Growth Rate: 37.50%
Updated:October 16 2025
huggingface.co

Total runs: 73
Run Growth: 13
Growth Rate: 17.81%
Updated:January 15 2026
huggingface.co

Total runs: 46
Run Growth: 0
Growth Rate: 0.00%
Updated:May 12 2024
huggingface.co

Total runs: 35
Run Growth: 0
Growth Rate: 0.00%
Updated:October 21 2026
huggingface.co

Total runs: 30
Run Growth: 0
Growth Rate: 0.00%
Updated:March 13 2024
huggingface.co

Total runs: 28
Run Growth: 28
Growth Rate: 100.00%
Updated:April 10 2025
huggingface.co

Total runs: 9
Run Growth: -6
Growth Rate: -66.67%
Updated:June 11 2025
huggingface.co

Total runs: 4
Run Growth: 0
Growth Rate: 0.00%
Updated:November 19 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 18 2024
huggingface.co

Total runs: 0
Run Growth: -2
Growth Rate: 0.00%
Updated:April 10 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 08 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:July 16 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 25 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 19 2026