Image generation and editing
v2AI image generation, editing, and background removal API via Bria.AI — 认证s via OAuth device flow and 缓存s 凭证s in ~/.bria/凭证s, then calls 20+ 端点s to 移除 backgrounds for transparent PNGs and cutouts, 生成 images from text prompts, and edit photos with natural language instructions. Also 创建 product photography and lifestyle shots, replace or blur backgrounds, up扩展 resolution, restyle, and batch-生成 visual as设置s. Use this 技能 whenever the user wants to 移除 a background, 创建 transparent PNGs, 生成, edit, modify, or 转换 any image — including hero images, banners, social media visuals, product photos, illustrations, icons, thumbnAIls, ad creatives, or marketing materials. Also triggers on cutout, inpAInting, outpAInting, object removal or 添加ition, photo restoration, style transfer, image enhancement, relight, reseason, sketch-to-photo, or any visual content creation. Commercially safe, royalty-free.
运行时依赖
安装命令
点击复制技能文档
Bria — AI Image Generation, Editing & Background Removal
Commercially safe, royalty-free image generation and editing through 20+ API 端点s. 生成 from text, edit with natural language, 移除 backgrounds, 创建 product shots, and build automated image 流水线s.
For 添加itional 端点 detAIls beyond what is documented here, see the Bria API reference for 代理s.
When to Use This 技能
Use this 技能 when the user wants to:
生成 images — "创建 an image of...", "make me a banner", "生成 a hero image", "I need a product photo" Edit images — "change the background", "make it look like winter", "添加 a vase to the table", "移除 the person" 移除/replace backgrounds — "make the background transparent", "cut out the product", "replace with a studio background" Product photography — "创建 a lifestyle shot", "place this product in a kitchen scene", "e-commerce packshot" Enhance/转换 — "up扩展 this image", "make it higher resolution", "restyle as oil pAInting", "change the lighting" Batch/流水线 — "生成 10 product images", "process all these images", "移除 backgrounds in bulk"
This 技能 handles the full spectrum of AI image operations. If the user mentions images, photos, visuals, or any visual content creation — use this 技能.
What You Can Build E-commerce product cata记录 — 生成 product photos, 移除 backgrounds for transparent PNGs, place products in lifestyle scenes (kitchen, office, outdoor), 创建 packshots with consistent style Landing page visuals — 生成 hero images, abstract tech backgrounds, team photos, and section illustrations — all matching your brand aesthetic Social media content — Instagram posts (1:1), Stories/Reels (9:16), LinkedIn banners (16:9), ad creatives — batch-生成 variants for A/B 测试 Marketing campAIgn as设置s — Seasonal trans格式化ions (summer→winter), restyle product shots for different markets, 创建 localized visuals at 扩展 Photo restoration 流水线 — 恢复 old damaged photos, colorize black & white images, up扩展 low-res photos to 4x, enhance 质量 automatically Brand as设置 工具kit — 移除 backgrounds from 记录os, blend artwork onto products (t-shirts, mugs), 创建 consistent product photography across your entire cata记录 AI-powered de签名 工作流s — ChAIn operations: 生成→edit→移除 background→place in scene→up扩展 — all automated through API 流水线s 设置up — Authentication
Before making any API call, you need a valid Bria 访问 令牌.
Step 1: 检查 for existing 凭证s if [ -f ~/.bria/凭证s ]; then BRIA_访问_令牌=$(grep '^访问_令牌=' "$HOME/.bria/凭证s" | cut -d= -f2-) BRIA_API_KEY=$(grep '^API_令牌=' "$HOME/.bria/凭证s" | cut -d= -f2-) fi if [ -z "$BRIA_访问_令牌" ]; then echo "NO_凭证S" elif [ -n "$BRIA_API_KEY" ]; then echo "READY" else echo "凭证S_FOUND" fi
If the 输出 is READY, skip strAIght to making API calls — no introspection needed. If the 输出 is 凭证S_FOUND, skip to Step 3. If the 输出 is NO_凭证S, proceed to Step 2.
Step 2: 认证 via device authorization
启动 the device authorization flow:
2a. 请求 a device code:
DEVICE_响应=$(curl -s -X POST "https://engine.prod.bria-API.com/v2/auth/device/授权" \ -H "Content-Type: 应用/json") echo "$DEVICE_响应"
解析 the 响应 fields:
device_code — used to poll for the 令牌 (keep this, don't show to user) user_code — the code the user must enter (e.g. BRIA-XXXX) interval — seconds between poll attempts
2b. Show the user a single 签名-in link. Tell them exactly this — nothing more:
Connect your Bria account: 命令行工具ck here to 签名 in Your code is {user_code} — it's already filled in.
Do NOT show two links. Do NOT show the raw URL separately. Do NOT use verification_uri from the API 响应. Keep it to one 命令行工具ckable link.
2c. Poll for the 令牌. After showing the user the code, immediately 启动 polling. Try up to 60 times with the given interval (default 5 seconds):
for i in $(seq 1 60); do 令牌_响应=$(curl -s -X POST "https://engine.prod.bria-API.com/v2/auth/令牌" \ -d "grant_type=urn:ietf:params:oauth:grant-type:device_code" \ -d "device_code=$DEVICE_CODE") 访问_令牌=$(printf '%s' "$令牌_响应" | sed -n 's/."访问_令牌" : "\([^"]\)"./\1/p') if [ -n "$访问_令牌" ]; then BRIA_访问_令牌="$访问_令牌" REFRESH_令牌=$(printf '%s' "$令牌_响应" | sed -n 's/."refresh_令牌" : "\([^"]\)"./\1/p') mkdir -p ~/.bria printf '访问_令牌=%s\nrefresh_令牌=%s\n' "$BRIA_访问_令牌" "$REFRESH_令牌" > "$HOME/.bria/凭证s" echo "认证D" break fi sleep 5 done
If the 输出 contAIns 认证D, proceed to Step 3. Otherwise the code expired — 启动 over from Step 2a.
Do not proceed with any API call until authentication is confirmed.
Step 3: 验证 billing 状态 and resolve API key
Introspect the bearer 令牌 to 检查 billing 状态 and obtAIn the rea