The Attribution Agent turns each output of a Bria model into a small, irreversible vector and sends only that vector to Bria. Your images and videos never leave your machine. Attribution is a condition of the self-hosted license, and it is how your usage is counted.
Fibo 2, RMBG 2.0 and RMBG 3.0 run the agent for you: setup() loads it and every execute attributes its output in the background. Don't install it next to them, or every output is attributed twice. Use this guide only when you run Bria weights outside Bria's packages, for example in your own inference code or on a third-party platform.
To tag those outputs with the application or end customer that produced them, pass attribution_agent="my-app" in the model's config, for example RemoveBGConfig(api_token=..., attribution_agent="my-app").
- An active self-hosted license for any Bria model (pricing). The agent comes with every license.
- One of your organization's API keys
- Python 3.10 or newer. A CPU is enough; an NVIDIA GPU makes it faster.
- Network access to the Bria Engine and Bria's weights CDN. The manual install also needs
curl,jqand network access to AWS CodeArtifact. - Disk space for the agent's weights: about 600 MB, or about 4 GB with video (see Weights)
Any self-hosted model license includes the agent. Buy one on the pricing page, and manage it on the Licenses tab in the Console.
Bria Studio installs the package for you:
npx @bria-ai/studioPick Attribution agent ("included with any license"). Studio installs bria_attribution[video] into a virtual environment at ~/.bria/venvs/attribution.
Run from the environment the agent is installed in. If you used Studio, activate the venv it created:
source ~/.bria/venvs/attribution/bin/activateLoad the agent once, then call it for every output your model generates:
import os
from PIL import Image
from attribution_agent import AttributionModel, BriaAttributionAgent
agent = BriaAttributionAgent(device="cuda", api_token=os.environ["BRIA_API_TOKEN"]) # or device="cpu"
agent.setup() # downloads the image weights from Bria on the first run
# Image: a PIL image
request_id = agent.execute_image(
image=Image.open("output.png"),
model=AttributionModel.IMAGE_RMBG_1, # the Bria model that made the output
api_token=os.environ["BRIA_API_TOKEN"],
agent="my-app",
)
# Video: a local path or URL. Needs the [video] extra.
request_id = agent.execute_video(
video="output.mp4",
model=AttributionModel.VIDEO_RMBG_1,
api_token=os.environ["BRIA_API_TOKEN"],
agent="my-app",
)Each call returns the request_id of the attribution request. agent names the application or end customer that produced the output. Calls are synchronous, so make them from a background thread or a queue to keep them off your generation path. A runnable notebook is in the BYOC attribution-agent folder.
The first setup() downloads the agent's weights from Bria with your API key (passed as api_token or set in BRIA_API_TOKEN), so no Hugging Face account is needed: the image model, and with the video extra the video model too. They are saved to ~/.bria/models/attribution/ (set BRIA_HOME to change ~/.bria), checked against their checksums, and reused on later runs, so later setups take seconds.
To use weights of your own, pass the image checkpoint's path as attribution_ckpt, and set VATTR_MOTION_MODEL_CKPT and VATTR_MOTION_MODEL_PATH for the video model.
model names the Bria model that produced the output. It decides which license the call is counted against.
| Bria model | AttributionModel |
|---|---|
| RMBG 2.0 | IMAGE_RMBG_1 |
| RMBG 3.0 | IMAGE_RMBG_3 |
| Fibo 2 | IMAGE_FIBO_2 |
| Fibo 2 Turbo | IMAGE_FIBO_TURBO_2 |
| Fibo Edit | IMAGE_FIBO_EDIT_1 |
| Eraser | IMAGE_ERASER_1 |
| Video background removal | VIDEO_RMBG_1 |
list(AttributionModel) prints every value your installed version supports.
The registry credential request answers 403
Your account holds no active self-hosted license, and the agent comes only with one. Buy or renew a license on the Licenses tab. In Studio, the same case reads "Attribution agent comes with any self-hosted model license, and this account holds none".
setup() fails downloading from Hugging Face (401 or 403)
The agent fell back to Hugging Face for its weights: it had no API key, the installed version is older than 0.7.0, or Bria's weights could not be reached (the log reads "Bria's attribution weights unavailable; using Hugging Face"). Pass api_token or set BRIA_API_TOKEN, upgrade to bria_attribution>=0.7.0, and allow network access to the Bria Engine and Bria's weights CDN.
Video attribution requires optional installation bria_attribution[video]
The package was installed without the video extra. Reinstall bria_attribution[video].
Agent isn't ready, please run .setup()
Call agent.setup() once before the first execute_image or execute_video.
Each call is counted as self-hosted usage of the model named in model, against that model's license, and shown in Usage & billing in the Console. See Self-hosted models for how licensing and billing work.