Spiral gives your agent every tool with one account. Browse the tools →

opencode · Image

How to Use Bria RMBG 2.0 in opencode

Bria RMBG 2.0 turns existing images into transparent cutouts for product listings, portraits, and design work. It preserves the original pixels and resolution, with optional wording to control which objects stay.

Prompts to try with Bria RMBG 2.0 in opencode

Copy an example into opencode, or ask in your own words.

Use Bria RMBG 2.0 on public/images/product.jpg and save the cutout beside the original for the catalog page.

Bria RMBG 2.0opencode
Try asking
  • Use Bria RMBG 2.0 on the team portraits in public/team, then build a preview so I can inspect hair edges.

  • Use Bria RMBG 2.0 on assets/room.jpg with the instruction 'only the chair' and preview the cutout.

  • Use Bria RMBG 2.0 on assets/yoga.jpg, keeping the person with the mat, for the exercise page.

  • Use Bria RMBG 2.0 to isolate the subject in assets/campaign.jpg, then place the cutout beside the existing campaign copy.

How to set up Bria RMBG 2.0 in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Bria RMBG 2.0

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "fal",
        "model": "fal-ai/bria/background/remove",
        "input": {
          "image_url": "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg"
        }
      }'

Then paste one of the prompts above: opencode finds Bria RMBG 2.0 on Spiral, shows the price and runs it.

Bria RMBG 2.0 providers and prices

Spiral runs Bria RMBG 2.0 through fal. Open a card for today's price, with every fee included.

falImage
Bria RMBG 2.0 · Remove Background
fal-ai/bria/background/remove

What can you do with Bria RMBG 2.0 in opencode?

Create transparent image assets from photos already in your project. Have the coding agent place the cutouts in layouts and prepare previews for edge inspection.

Product listing cutouts

Isolate products from existing photos for placement in catalog layouts.

Portraits for team pages

Separate people from portrait backgrounds before arranging a consistent team page. Inspect loose hair before publishing.

Advertising compositions

Extract a photographed subject for placement alongside campaign copy and other design elements.

Stock-image collages

Turn subjects from stock images into transparent layers for editorial compositions.

Furniture selection

Keep one chair from a furnished-room photo using a specific selection instruction.

People with essential props

Keep a person together with a relevant object, such as a yoga mat, for instructional artwork.

Questions about Bria RMBG 2.0 in opencode

Can opencode use Bria RMBG 2.0?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Bria RMBG 2.0 like any built-in tool.

How much does Bria RMBG 2.0 cost in opencode?

$0.03900078 per generation. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

Do I need a fal account to use Bria RMBG 2.0 in opencode?

No. Spiral runs Bria RMBG 2.0 on its own fal account. You sign in to Spiral once and never paste a key.

How long does it take to set up Bria RMBG 2.0 in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while Bria RMBG 2.0 runs?

Bria RMBG 2.0 runs in the background. opencode starts the run, checks on it and gives you the image when it's ready.

What is Bria RMBG 2.0 useful for?

Use it to isolate subjects from existing images for product listings, advertising layouts, stock-image compositions, and design assets.

Does Bria RMBG 2.0 repaint the subject?

Background removal changes transparency while preserving the original image pixels. Treat the result as a cutout to compose elsewhere.

What resolution does the cutout have?

Bria documents output at the original image resolution. Background removal does not add image detail or enlarge the source.

How should I describe what to keep?

Name the objects that belong in the cutout, such as 'the person with the mat' or 'only the chair.' Describe selection changes rather than requesting a new scene.

Which details should I inspect before using a cutout?

Inspect loose hair, fur, glass, and fine edges. Bria reports cleaner results on these details with RMBG 3.0, so review them carefully in RMBG 2.0 output.

Get started

Start using Bria RMBG 2.0 in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options