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

opencode · Image

How to Use BEN v2 in opencode

BEN v2 removes backgrounds from existing photos to prepare product cutouts, portraits, and design assets. Its focus includes hair matting and fine edges, though low contrast and compression can still cause halos.

Prompts to try with BEN v2 in opencode

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

Use BEN v2 to remove the backgrounds from the product photos in public/products. Save separate PNG cutouts and build a preview page on white and dark backgrounds for review.

BEN v2opencode
Try asking
  • Use BEN v2 on the staff portraits in this project. Add the cutouts to a draft team page and show enlarged previews of hair and shoulder edges.

  • Use BEN v2 on the hero product photo in this project. Create a transparent asset and show it on the landing page's actual background so I can inspect the boundary.

  • Use BEN v2 to remove the background from the raster sponsor logo in this project. Show the original and result at full size so I can check lettering and thin strokes.

  • Use BEN v2 to compare the original product photo with a tighter crop near square. Keep the whole product visible and build a side-by-side preview of the resulting edges.

How to set up BEN v2 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 BEN v2

    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/ben/v2/image",
        "input": {
          "image_url": "https://storage.googleapis.com/falserverless/gallery/Ben2/arduino-uno-board-electronics-hand-600nw-1869855883.webp"
        }
      }'

Then paste one of the prompts above: opencode finds BEN v2 on Spiral, shows the price and runs it.

BEN v2 providers and prices

Spiral runs BEN v2 through fal. Open a card for today's price, with every fee included.

falImage

Settings you can ask for

BEN v2 works from your image URL. Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Seeda whole number

Random seed for reproducible generation.

Every API field of BEN v2 · Background Remover (image) is on its tool page: open its card above.

What can you do with BEN v2 in opencode?

Prepare transparent product and portrait assets for your project's pages with BEN v2. Have the coding agent add previews that make edge defects easy to inspect before replacing existing assets.

Product listing cutouts

Remove the background from product photos, then place approved cutouts on a consistent listing background. Inspect thin handles and small label text.

Portraits for team pages

Prepare portrait cutouts for staff pages and speaker layouts. Review hair and shoulder edges against the page background.

Fashion catalog layouts

Isolate clothing or photographed models for catalog compositions. Keep the full garment visible in the source and review fine boundaries.

Advertising compositions

Extract a photographed product for reuse across ad layouts. Keep a transparent master so each composition can use a different background.

Presentation assets

Turn product and portrait photos into cutouts for slides. Preview the result on the slide color to catch visible halos.

Logo background removal

Remove a background from a sharp raster logo for placement in a layout. Inspect thin strokes and lettering before approving it.

Questions about BEN v2 in opencode

Can opencode use BEN v2?

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

How much does BEN v2 cost in opencode?

$0.0325 per 1,048,576 megapixels. Minimum 1,048,576 pixels. 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 BEN v2 in opencode?

No. Spiral runs BEN v2 on its own fal account. You sign in to Spiral once and never paste a key.

How long does it take to set up BEN v2 in opencode?

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

Does opencode wait while BEN v2 runs?

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

What is BEN v2 useful for?

BEN v2 removes backgrounds from existing photos. Use the cutouts in product listings, portrait layouts, catalogs, and ads.

Can BEN v2 handle hair and fine edges?

The maker highlights hair matting and edge refinement as strengths. Inspect loose hair and soft boundaries before using the cutout in a finished design.

Where can BEN v2 cutouts need cleanup?

Hair, fur, and transparent objects can retain rough edges, halos, or color fringing. Review those areas closely before approving the result.

How should I prepare an image for BEN v2?

Start with a sharp original and a clearly visible subject. Where practical, crop toward a square while keeping the whole subject inside the frame.

Why can very wide or tall images lose detail?

The maker explains that background removal uses a fixed internal working size. Extreme proportions can leave fewer effective pixels for the subject, so try a tighter crop before processing.

Get started

Start using BEN v2 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