Skip to main content
bria avatar

Bria GenFill V2 API

bria/genfill/v2

Fill a masked region of your image with new content from a text instruction, with commercially safe outputs cleared for risk-free business use.

edit
0.04 per megapixel of image

Model Input

Input

Describe what should be generated inside the masked region of the source image.

The source image to edit.

A binary black-and-white mask the same size as the source image. White marks the region to fill; black is preserved.

Additional Settings

Customize your input with more control.

Random seed for reproducibility. The same seed, instruction, image, and mask produce the same result.

Min: 20 - Max: 50

Number of inference steps (20-50). Higher values can improve detail at the cost of latency.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Loading
Generated in 20.146 seconds
Logs (1 lines)

Model Example Requests

Examples

Example output 1Example output 2

Bria GenFill V2 API

Bria GenFill V2 is a image-to-image AI model by bria. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.04 per megapixel.

POST https://queue.modelrunner.run/bria/genfill/v2

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/bria/genfill/v2 \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "seed": 5555,
    "mask_url": "https://bria-datasets.s3.us-east-1.amazonaws.com/Fibo_edit/flower_input_mask.png",
    "image_url": "https://bria-datasets.s3.us-east-1.amazonaws.com/Fibo_edit/flower.png",
    "steps_num": 20,
    "instruction": "A beautiful colorful butterfly",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/bria/genfill/v2/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/bria/genfill/v2/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("bria/genfill/v2", {
  input: {
    "seed": 5555,
    "mask_url": "https://bria-datasets.s3.us-east-1.amazonaws.com/Fibo_edit/flower_input_mask.png",
    "image_url": "https://bria-datasets.s3.us-east-1.amazonaws.com/Fibo_edit/flower.png",
    "steps_num": 20,
    "instruction": "A beautiful colorful butterfly"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/bria/genfill/v2",
    headers=headers,
    json={
      "seed": 5555,
      "mask_url": "https://bria-datasets.s3.us-east-1.amazonaws.com/Fibo_edit/flower_input_mask.png",
      "image_url": "https://bria-datasets.s3.us-east-1.amazonaws.com/Fibo_edit/flower.png",
      "steps_num": 20,
      "instruction": "A beautiful colorful butterfly"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
instructionstringyesDescribe what should be generated inside the masked region of the source image.
image_urlstring (uri)yesThe source image to edit.
mask_urlstring (uri)yesA binary black-and-white mask the same size as the source image. White marks the region to fill; black is preserved.
seedintegernoRandom seed for reproducibility. The same seed, instruction, image, and mask produce the same result. Default: 5555.
steps_numintegernoNumber of inference steps (20-50). Higher values can improve detail at the cost of latency. Default: 30.

Machine-readable: OpenAPI schema · llms.txt

Use Bria GenFill V2 from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Bria GenFill V2 becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint bria/genfill/v2.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run bria/genfill/v2 on ModelRunner to generate image”. MCP setup guide.

Model Details

Model Details

GenFill V2 performs generative fill (inpainting) on an image you provide. You pass a source image, a binary black-and-white mask marking the region to change, and a short text instruction describing what should appear there. The model regenerates only the masked area and blends it into the surrounding pixels, matching the existing lighting, perspective, and style. Its standout is that outputs are commercially safe and cleared for risk-free business use, so generated content can ship in production work without licensing worry.

## Best for - Adding an object or element inside a precise region of a photo (a product on a shelf, a prop on a table, a sign on a wall) - Removing an unwanted element by masking it and instructing a replacement (clear a person from a background, swap a label) - Localized retouching and repair where only one area should change and the rest must stay pixel-identical - Product and marketing imagery where the result must be safe to use commercially

## Choose another model when - You want a brand-new image from a text prompt with no source image — use a text-to-image model - You want to restyle or transform the whole image rather than fill one masked region — use a general image-to-image / image-editing model - You need to extend the canvas beyond the image borders (outpainting) — this model fills inside a mask only and does not expand the frame

## Tips - The `mask_url` image must match the source dimensions exactly; white pixels mark the region to fill, black pixels are preserved - Clean, well-aligned mask edges prevent visible seams — ragged masks leave artifacts at the boundary - Keep the mask close to the size of the object you want; oversized masks invite unwanted background changes, and very small masks leave too little room for fine detail - Write a concrete `instruction` for only what belongs in the masked area, not a full-scene description

## Advanced Configuration

### steps_num Number of inference steps, 20–50 (default 30). Higher values can improve detail and coherence at the cost of latency; lower values are faster. Leave it at the default unless you need to trade quality against speed.

To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("bria/genfill/v2", { input: { image_url: "https://media.modelrunner.ai/example-source.png", mask_url: "https://media.modelrunner.ai/example-mask.png", instruction: "a beautiful colorful butterfly", }, }); ```