AGENT SKILL

bria-ai

Generate, edit, and transform images with commercially-safe AI models. Create images from text, edit by natural language instruction, remove backgrounds (transparent PNG), replace backgrounds, add/replace/remove objects, inpaint, outpaint, upscale (2x/4x), enhance quality, restyle (oil painting, anime, 3D), relight, reseason, restore old photos, colorize, sketch to photo, and product lifestyle shots. Use for websites, apps, presentations needing hero images, banners, product photos, product placement in scenes, icons, illustrations, or backgrounds. Also for e-commerce photography, batch generation, and pipelines. Triggers are image generation, generate/create image, edit photo, remove background, transparent PNG, replace background, product shot, lifestyle scenes, upscale, style transfer, photo restoration, colorize, sketch to image, outpaint, inpaint, cut out subject, integrate products into scene.

License 许可
MIT
最近更新
2026-09-30
Stars
★ 3
Forks
0

01 前言 Front Matter

name
bria-ai
license
MIT
metadata
{ "author": "Bria AI", "version": "1.2.6", "openclaw": { "requires": { "env": [ "BRIA_API_KEY" ], "bins": [ "curl" ] }, "primaryEnv": "BRIA_API_KEY" } }
description
Generate, edit, and transform images with commercially-safe AI models. Create images from text, edit by natural language instruction, remove backgrounds (transparent PNG), replace backgrounds, add/replace/remove objects, inpaint, outpaint, upscale (2x/4x), enhance quality, restyle (oil painting, anime, 3D), relight, reseason, restore old photos, colorize, sketch to photo, and product lifestyle shots. Use for websites, apps, presentations needing hero images, banners, product photos, product placement in scenes, icons, illustrations, or backgrounds. Also for e-commerce photography, batch generation, and pipelines. Triggers are image generation, generate/create image, edit photo, remove background, transparent PNG, replace background, product shot, lifestyle scenes, upscale, style transfer, photo restoration, colorize, sketch to image, outpaint, inpaint, cut out subject, integrate products into scene.

02 资源文件 7

03 SKILL.md 正文

Bria — Generate, Edit & Remove Background from Images with AI

Generate, edit, and create visual assets using Bria's commercially-safe AI models (Fibo, Fibo-Edit, RMBG-2.0, GenFill, and more). Remove or replace backgrounds, create product lifestyle shots, generate transparent PNGs, batch generate images, and build pipeline workflows. Unlike black-box generators, Bria gives you fine-grained control: edit by text instruction, mask specific regions, add/replace/remove individual objects, change lighting or season independently.

Setup — API Key Check

Before making any Bria API call, check for the API key and help the user set it up if missing:

Step 1: Check if the key exists (without printing the key)

if [ -z "$BRIA_API_KEY" ]; then
  echo "BRIA_API_KEY is not set"
else
  echo "BRIA_API_KEY is set"
fi

If the output is not empty, skip to the next section.

Step 2: If the key is missing, guide the user

Tell the user exactly this:

To use image generation, you need a free Bria API key.

  1. Go to https://platform.bria.ai/console/account/api-keys
  2. Sign up or log in
  3. Click Create API Key

Wait for the user to provide their API key. Do not proceed until they give you the key.

Do not proceed with any image generation or editing until the API key is confirmed set.


Core Capabilities

Need Capability Use Case
Generate images from text FIBO Generate Hero images, product shots, illustrations, social media images, banners
Edit images by text instruction FIBO-Edit Change colors, modify objects, transform scenes
Edit image region with mask GenFill/Erase Precise inpainting, add/replace specific regions
Add/Replace/Remove objects Text-based editing Add vase, replace apple with pear, remove table
Remove background (transparent PNG) RMBG-2.0 Extract subjects for overlays, logos, cutouts
Replace/blur/erase background Background ops Change, blur, or remove backgrounds
Expand/outpaint images Outpainting Extend boundaries, change aspect ratios
Upscale image resolution Super Resolution Increase resolution 2x or 4x
Enhance image quality Enhancement Improve lighting, colors, details
Restyle images Restyle Oil painting, anime, cartoon, 3D render
Change lighting Relight Golden hour, spotlight, dramatic lighting
Change season Reseason Spring, summer, autumn, winter
Composite/blend images Image Blending Apply textures, logos, merge images
Restore old photos Restoration Fix old/damaged photos
Colorize images Colorization Add color to B&W, or convert to B&W
Sketch to photo Sketch2Image Convert drawings to realistic photos
Create product lifestyle shots Lifestyle Shot Place products in scenes for e-commerce
Integrate products into scenes Product Integrate Embed products at exact coordinates

Quick Reference

Generate an Image (FIBO)

curl -X POST "https://engine.prod.bria-api.com/v2/image/generate" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{
    "prompt": "your description",
    "aspect_ratio": "16:9",
    "resolution": "1MP",
    "sync": true
  }'

Aspect ratios: 1:1 (square), 16:9 (hero/banner), 4:3 (presentation), 9:16 (mobile/story), 3:4 (portrait)

Resolution: 1MP (default) or 4MP (improved details for photorealism, adds ~30s latency)

Sync mode: Pass "sync": true in the request body for single image generation to get the result directly in the response. For batch/multiple image generation, omit sync (or set false) and use polling instead.

Advanced: For precise, deterministic control over generation, use VGL structured prompts instead of natural language. VGL defines every visual attribute (objects, lighting, composition) as explicit JSON.

Remove Background (RMBG-2.0)

curl -X POST "https://engine.prod.bria-api.com/v2/image/edit/remove_background" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{"image": "https://..."}'

Returns PNG with transparency.

Edit Image (FIBO-Edit) - No Mask Required

curl -X POST "https://engine.prod.bria-api.com/v2/image/edit" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{
    "images": ["https://..."],
    "instruction": "change the mug to red"
  }'

Edit Image Region with Mask (GenFill)

curl -X POST "https://engine.prod.bria-api.com/v2/image/edit/gen_fill" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{
    "image": "https://...",
    "mask": "https://...",
    "prompt": "what to generate in masked area"
  }'

Expand Image (Outpainting)

curl -X POST "https://engine.prod.bria-api.com/v2/image/edit/expand" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{
    "image": "base64-or-url",
    "aspect_ratio": "16:9",
    "prompt": "coffee shop background, wooden table"
  }'

Upscale Image

curl -X POST "https://engine.prod.bria-api.com/v2/image/edit/increase_resolution" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{"image": "https://...", "scale": 2}'

Create Product Lifestyle Shot

curl -X POST "https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_text" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{
    "image": "https://product-with-transparent-bg.png",
    "prompt": "modern kitchen countertop, natural morning light"
  }'

Integrate Products into Scene

Place one or more products at exact coordinates in a scene. Products are automatically cut out and matched to the scene's lighting and perspective.

curl -X POST "https://engine.prod.bria-api.com/image/edit/product/integrate" \
  -H "api_token: $BRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: BriaSkills/1.2.6" \
  -d '{
    "scene": "https://scene-image-url",
    "products": [
      {
        "image": "https://product-image-url",
        "coordinates": {"x": 100, "y": 200, "width": 300, "height": 400}
      }
    ]
  }'

Response Handling

Sync (single image generation)

For single image requests, pass "sync": true in the request body. The response returns the result directly — no polling needed.

Async with polling (batch generation)

For batch or multiple image generation, omit sync (or set "sync": false). The response returns a status URL to poll:

{
  "request_id": "uuid",
  "status_url": "https://engine.prod.bria-api.com/v2/status/uuid"
}

Poll the status_url until status: "COMPLETED", then get result.image_url.

import requests, time

def get_result(status_url, api_key):
    while True:
        r = requests.get(status_url, headers={"api_token": api_key, "User-Agent": "BriaSkills/1.2.6"})
        data = r.json()
        if data["status"] == "COMPLETED":
            return data["result"]["image_url"]
        if data["status"] == "FAILED":
            raise Exception(data.get("error"))
        time.sleep(2)

Prompt Engineering Tips

  • Style: "professional product photography" vs "casual snapshot", "flat design illustration" vs "3D rendered"
  • Lighting: "soft natural light", "studio lighting", "dramatic shadows"
  • Background: "white studio", "gradient", "blurred office", "transparent"
  • Composition: "centered", "rule of thirds", "negative space on left for text"
  • Quality keywords: "high quality", "professional", "commercial grade", "4K", "sharp focus"
  • Negative prompts: "blurry, low quality, pixelated", "text, watermark, logo"

API Reference

See references/api-endpoints.md for complete endpoint documentation.

Key Endpoints

Image Generation

Endpoint Purpose
POST /v2/image/generate Generate images from text (FIBO)

Edit by Text (No Mask)

Endpoint Purpose
POST /v2/image/edit Edit image with natural language instruction
POST /v2/image/edit/add_object_by_text Add objects to image
POST /v2/image/edit/replace_object_by_text Replace objects in image
POST /v2/image/edit/erase_by_text Remove objects by name

Edit with Mask

Endpoint Purpose
POST /v2/image/edit/gen_fill Inpaint/generate in masked region
POST /v2/image/edit/erase Erase masked region

Background Operations

Endpoint Purpose
POST /v2/image/edit/remove_background Remove background (RMBG-2.0)
POST /v2/image/edit/replace_background Replace with AI-generated background
POST /v2/image/edit/blur_background Apply blur to background
POST /v2/image/edit/erase_foreground Remove foreground, fill background
POST /v2/image/edit/crop_foreground Crop tightly around subject

Image Transformation

Endpoint Purpose
POST /v2/image/edit/expand Outpaint to new aspect ratio
POST /v2/image/edit/enhance Enhance quality and details
POST /v2/image/edit/increase_resolution Upscale 2x or 4x
POST /v2/image/edit/blend Blend/merge images or textures
POST /v2/image/edit/reseason Change season/weather
POST /v2/image/edit/restyle Transform artistic style
POST /v2/image/edit/relight Modify lighting

Restoration

Endpoint Purpose
POST /v2/image/edit/sketch_to_colored_image Convert sketch to photo
POST /v2/image/edit/restore Restore old/damaged photos
POST /v2/image/edit/colorize Colorize B&W or convert to B&W

Product Photography

Endpoint Purpose
POST /v1/product/lifestyle_shot_by_text Create product lifestyle shots by text
POST /image/edit/product/integrate Integrate products into scene at exact coordinates

Utilities

Endpoint Purpose
POST /v2/structured_instruction/generate Generate JSON instruction (no image)
GET /v2/status/{id} Check async request status

Authentication

All requests need api_token header:

api_token: YOUR_BRIA_API_KEY
User-Agent: BriaSkills/<version>

Required: Always include the User-Agent: BriaSkills/<version> header (where <version> is the current skill version from package.json, e.g. BriaSkills/1.2.6) in every API call, including status polling requests.


Additional Resources

Related Skills

  • vgl — Write structured VGL JSON prompts for precise, deterministic control over FIBO image generation
  • image-utils — Classic image manipulation (resize, crop, composite, watermarks) for post-processing

04 同仓库更多 Skills

Jinhong270
Jinhong270/AI-Agent

xlsx

Open, create, read, analyze, edit, repair, or validate spreadsheet files (.xlsx, .xlsm, .xltx, .csv, .tsv) with zero format loss, with first-class support for Chinese / CJK content. Use whenever the user asks to create, build, modify, fill, analyze, read, repair, validate, or format any spreadsheet, workbook, report, dashboard, budget, financial model, pivot table, or tabular data file. Handles Chinese text, encodings (UTF-8 / GB18030 / GBK), full-width characters, CJK fonts in rendering, and Chinese number/date conventions (¥, 万/亿, 年/月/日). Covers: creating new workbooks from scratch, reading and analyzing existing files, editing existing workbooks while preserving pivot tables / VBA macros / charts / sparklines / conditional formatting / named ranges, formula recalculation and validation, visual review of results, and applying professional formatting. Triggers on 'spreadsheet', 'Excel', 'workbook', '表格', '工作簿', '.xlsx', '.xlsm', '.csv', 'pivot table', '透视表', 'macro', '宏', 'chart', '图表', 'financial model', '财务模型', 'formula', '公式', or any request to produce tabular data.

★ 3
Jinhong270
Jinhong270/AI-Agent

xlsx-formula-master

你描述需求(人话),它给你 Excel / WPS 公式 + 解释 + 不踩坑的边界条件。 专攻 VLOOKUP / XLOOKUP / INDEX-MATCH / SUMIFS / 数组公式 / 动态数组 / Power Query 等高频但易错场景。 自动适配你的 Excel 版本(2019 / 365 / WPS)——版本不同公式可能不能用。 触发:用户说 "Excel 公式"、"VLOOKUP"、"怎么算"、"WPS 公式"、"求和怎么写"、"匹配数据"、"数据透视"。

★ 3
Jinhong270
Jinhong270/AI-Agent

self-improving-agent

Self-improving agent system that analyzes conversation quality, identifies improvement opportunities, and continuously optimizes response strategies.

★ 3
Jinhong270
Jinhong270/AI-Agent

xiaohongshu-content-tools

小红书运营数据工具|当提到小红书关键词搜索,小红书笔记详情及评论,小红书博主作品时使用,可实现爆款挖掘/竞品分析/KOL筛选/趋势洞察,用数据驱动小红书流量增长,告别盲目创作

★ 3
Jinhong270
Jinhong270/AI-Agent

xfg-ddd-skills

DDD 六边形架构设计与部署技能包。提供 Domain/Case/Infrastructure 层设计模式与代码模板,以及 Docker 环境部署脚本。当用户询问 DDD 架构、设计模式或需要部署项目时调用。

★ 3
Jinhong270
Jinhong270/AI-Agent

wordpress

WordPress.com API integration with managed OAuth. Manage posts, pages, sites, and content. Use this skill when users want to create, read, update, or delete WordPress.com posts, pages, or manage site content. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.

★ 3