Skip to content
FramesField
SKILL.md Beginner Setup (1 Command) SKILL.md
Verified Dec 1, 2026

Bria RMBG 2.0, BiRefNet v2 & IC-Light V2 fal.ai Skill

How to install this SKILL.md

Drop into .claude/skills/, .cursor/skills/, or .agents/skills/ to automate licensed cutouts, hair/glass alpha masks, and physically consistent product relighting from your coding agent.

Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to automate zero-halo product cutouts and directional relighting under one FAL_KEY: Bria RMBG 2.0 ($0.018 licensed API / $0.03 prompted), MIT BiRefNet v2 (2048px matting with refine_foreground + output_mask), and IC-Light V2 ($0.10/MP with initial_latent light direction + Topaz 24MP finish).

Compatible agent hosts
Claude Code Cursor Codex
Target tool: fal.ai API / Bria RMBG 2.0 / BiRefNet v2 / IC-Light V2 · License: MIT
  1. STEP 01
    Install pure SKILL.md from /raw/skills/

    Run the copy-paste installer for Claude Code, Cursor, or Codex below.

  2. STEP 02
    Route cutouts by license & edge complexity

    Agent picks Bria RMBG 2.0 ($0.018 licensed / $0.03 prompted) or MIT BiRefNet v2 (2048px refine_foreground + output_mask) cleanly.

  3. STEP 03
    Relight directionally at 1MP, then upscale approved picks

    Runs IC-Light V2 ($0.10/MP, initial_latent Left/Right/Top) before optional Topaz 24MP ($0.08) so you never overpay megapixels on drafts.

1. Install for your tool

Pick the app you use below for the exact verified command or config—zero manual guessing.

Direct raw file (SKILL.md) ↓
Claude Code bash
Installs pure SKILL.md bytes directly into Claude Code:
mkdir -p .claude/skills/bria-birefnet-iclight-fal
curl -fsSL https://framesfield.com/raw/skills/bria-rmbg-birefnet-and-iclight-relight-fal-skill \
  -o .claude/skills/bria-birefnet-iclight-fal/SKILL.md

2. Inspect or download the full SKILL.md file

This is the exact raw file served at /raw/skills/bria-rmbg-birefnet-and-iclight-relight-fal-skill.

Bria RMBG 2.0, BiRefNet v2 & IC-Light V2 fal.ai Skill SKILL.md
---
name: bria-birefnet-iclight-fal
description: Automate fal.ai background removal, 2048px alpha matting, and directional product relighting using Bria RMBG 2.0 (fal-ai/bria/background/remove at $0.018/cutout or $0.03 prompted, 100%-licensed commercial data), BiRefNet v2 (fal-ai/birefnet/v2, MIT open weights with refine_foreground and output_mask), and IC-Light V2 (fal-ai/iclight-v2 at $0.10/MP with initial_latent directional bias). Use when removing product/portrait backgrounds without edge halos or relighting cutouts into photoreal studio scenes.
---

# Bria RMBG 2.0, BiRefNet v2 & IC-Light V2 fal.ai Skill

## 1. Pre-Flight Routing & License Guardrails (Always Print Cost First)
- **Bria RMBG 2.0 (`fal-ai/bria/background/remove`):** `$0.018` per standard cutout (`$0.03` when passing optional `prompt` to isolate a single named item). Trained 100% on licensed data. **Licensing warning:** Never advise commercial users to self-host Hugging Face `briaai/RMBG-2.0` weights (CC BY-NC-4.0)—use paid Bria API or MIT BiRefNet v2 locally.
- **BiRefNet v2 (`fal-ai/birefnet/v2` · MIT):** Use whenever the user needs `output_mask: true` (standalone grayscale matte), `operating_resolution: "2048x2048"` for wispy hair/glass (`model: "Matting"`), or `$0` local MIT self-hosting. Always enable `refine_foreground: true` to strip white backdrop halos.
- **IC-Light V2 (`fal-ai/iclight-v2`):** **`$0.10` per output megapixel**. Always draft at `1MP` (`square_hd` / `1024x1024` = `$0.10`)—NEVER upscale to 4K before calling IC-Light V2! Run Topaz Image API (`$0.08` <=24MP) once on approved relit winners.

## 2. Step 1A — Bria RMBG 2.0 Licensed Cutout ($0.018 | $0.03 w/ prompt)
```bash
curl -sS -X POST "https://fal.run/fal-ai/bria/background/remove" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"'"$IMAGE_URL"'"}'
```
*(Optional single-object extraction from cluttered scenes: add `"prompt":"amber glass bottle"` -> `$0.03`.)*

## 3. Step 1B — BiRefNet v2 2048px Matting + Decontaminated Alpha Mask
```bash
curl -sS -X POST "https://fal.run/fal-ai/birefnet/v2" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "'"$IMAGE_URL"'",
    "model": "Matting",
    "operating_resolution": "2048x2048",
    "refine_foreground": true,
    "output_mask": true,
    "output_format": "png"
  }'
```

## 4. Step 2 — IC-Light V2 Directional Relighting ($0.10/MP)
Match `initial_latent` (`Left` | `Right` | `Top` | `Bottom`) to the scene's actual light source and keep `enable_hr_fix: true`:
```bash
curl -sS -X POST "https://fal.run/fal-ai/iclight-v2" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "'"$CUTOUT_URL"'",
    "prompt": "Product resting on warm honed travertine plinth, morning sunlight from frame left casting soft grounded shadow to the right, crisp studio packshot",
    "initial_latent": "Left",
    "image_size": "square_hd",
    "enable_hr_fix": true,
    "output_format": "png",
    "seed": 4096
  }'
```
Verify zero floating gap under product base and crisp fine-print labels before optionally calling `fal-ai/topaz/upscale/image` (`$0.08` <=24MP).

3. Test it right away (sample prompt & result)

Sample prompt / input
Cut out our matte black ceramic coffee mug using Bria RMBG 2.0 ($0.018), relight it on warm travertine with morning sun from frame left via IC-Light V2 ($0.10), and upscale the approved hero to 24MP via Topaz ($0.08).
What happens when it runs
Pre-flight estimate: $0.198 ($0.018 Bria RMBG 2.0 + $0.10 IC-Light V2 1MP + $0.08 Topaz 16.8MP PNG).
1) Extracted halo-free RGBA -> 01_mug_cutout.png
2) Relit with initial_latent="Left" + enable_hr_fix=true -> 02_mug_relit_1024.png
3) Upscaled 4x -> 03_mug_hero_4096.png (verified crisp grounded shadow & zero white edge fringe).

What you need & known limits

Requirements

  • FAL_KEY environment variable from fal.ai
  • Local curl and jq on PATH

Watch out for

  • Never upscale source images to 4K before IC-Light V2 (multiplies megapixel billing 8x–16x)
  • For tiny 6pt regulated cosmetic or beverage labels, inspect relit pixels at 200% and composite the original sharp label crop if needed

Automated zero-halo cutouts and photoreal product relighting from your CLI

Cutting products cleanly and harmonizing lighting physics used to require three separate tools and manual Photoshop brush masking. This SKILL.md gives your coding agent verified endpoints, licensing boundaries, and megapixel-safe defaults across Bria RMBG 2.0, BiRefNet v2, and IC-Light V2.

Frequently Asked Questions

When should my agent choose BiRefNet v2 over Bria RMBG 2.0?
Choose BiRefNet v2 whenever you need a standalone grayscale alpha mask (output_mask: true), 2048×2048 high-resolution hair/glass matting with refine_foreground color decontamination, or a $0 local MIT open-weight pipeline. Choose Bria RMBG 2.0 when enterprise legal rules mandate 100%-licensed commercial training provenance or $0.03 prompt-targeted extraction.
Why pin initial_latent in IC-Light V2?
Setting initial_latent to Left, Right, Top, or Bottom aligns the model's internal light map with your text prompt so specular highlights and floor shadows fall consistently across every retry.
Use this page in AI tools or notes
raw .md