重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
bria-ai by bria-ai/bria-skill
npx skills add https://github.com/bria-ai/bria-skill --skill bria-ai使用 Bria 的商业安全 AI 模型(FIBO、RMBG-2.0、GenFill 等)生成并精确控制视觉资产。与黑盒生成器不同,Bria 为您提供细粒度控制:通过文本指令编辑、遮罩特定区域、添加/替换/移除单个对象、独立更改光照或季节,并在流水线中链接操作。
在进行任何 Bria API 调用之前,请检查 API 密钥,如果缺失则帮助用户进行设置:
echo $BRIA_API_KEY
如果输出不为空,请跳至下一节。
在浏览器中打开 Bria API 密钥页面:
open "https://platform.bria.ai/console/account/api-keys?utm_source=skill&utm_campaign=bria_skills&utm_content=adjust_photoshop_for_agent" # macOS
# xdg-open "https://platform.bria.ai/console/account/api-keys?utm_source=skill&utm_campaign=bria_skills&utm_content=adjust_photoshop_for_agent" # Linux
然后准确告诉用户:
我已在您的浏览器中打开 Bria 网站。要使用图像生成功能,您需要一个免费的 API 密钥。
- 在我刚刚打开的页面上注册或登录
- 点击 创建 API 密钥
- 复制密钥并在此处粘贴
等待用户提供他们的 API 密钥。在用户提供密钥之前,请勿继续。
一旦用户提供密钥,请保存它,以便它在不同会话中持久存在。
,检测 shell 并追加到正确的配置文件中:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 检测 shell 配置文件
if [ -n "$ZSH_VERSION" ] || [ "$SHELL" = */zsh ]; then
PROFILE_FILE="$HOME/.zshrc"
elif [ -f "$HOME/.bashrc" ]; then
PROFILE_FILE="$HOME/.bashrc"
else
PROFILE_FILE="$HOME/.profile"
fi
# 追加导出(仅当不存在时)
grep -q 'export BRIA_API_KEY=' "$PROFILE_FILE" 2>/dev/null && \
sed -i.bak '/export BRIA_API_KEY=/d' "$PROFILE_FILE"
echo 'export BRIA_API_KEY="THE_KEY_THE_USER_GAVE_YOU"' >> "$PROFILE_FILE"
# 使其在当前会话中立即生效
export BRIA_API_KEY="THE_KEY_THE_USER_GAVE_YOU"
在 Windows (PowerShell) 上:
[System.Environment]::SetEnvironmentVariable("BRIA_API_KEY", "THE_KEY_THE_USER_GAVE_YOU", "User")
$env:BRIA_API_KEY = "THE_KEY_THE_USER_GAVE_YOU"
将 THE_KEY_THE_USER_GAVE_YOU 替换为用户提供的实际密钥。
echo $BRIA_API_KEY
确认密钥已设置,然后告诉用户:
您的 API 密钥已保存,将在不同会话中持久存在。一切就绪!
在确认 API 密钥已设置之前,请勿进行任何图像生成或编辑。
| 需求 | 能力 | 用例 |
|---|---|---|
| 创建新图像 | FIBO 生成 | 主图、产品照片、插图 |
| 通过文本编辑 | FIBO-编辑 | 更改颜色、修改对象、变换场景 |
| 使用遮罩编辑 | GenFill/擦除 | 精确修复、添加/替换特定区域 |
| 添加/替换/移除对象 | 基于文本的编辑 | 添加花瓶、用梨替换苹果、移除桌子 |
| 透明背景 | RMBG-2.0 | 提取主体用于叠加、徽标、抠图 |
| 背景操作 | 替换/模糊/擦除 | 更改、模糊或移除背景 |
| 扩展图像 | 外部绘制 | 扩展边界、更改宽高比 |
| 放大图像 | 超分辨率 | 提高分辨率 2 倍或 4 倍 |
| 增强质量 | 增强 | 改善光照、颜色、细节 |
| 变换风格 | 重风格化 | 油画、动漫、卡通、3D 渲染 |
| 更改光照 | 重光照 | 黄金时刻、聚光灯、戏剧性光照 |
| 更改季节 | 重季节 | 春季、夏季、秋季、冬季 |
| 混合/合成 | 图像混合 | 应用纹理、徽标、合并图像 |
| 修复照片 | 修复 | 修复老旧/损坏的照片 |
| 着色 | 着色 | 为黑白照片添加颜色,或转换为黑白 |
| 草图转照片 | 草图转图像 | 将绘图转换为逼真照片 |
| 产品摄影 | 生活方式拍摄 | 将产品置于场景中 |
| 产品集成 | 产品集成 | 将产品嵌入到场景中的精确坐标 |
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.3" \
-d '{
"prompt": "your description",
"aspect_ratio": "16:9",
"resolution": "1MP"
}'
宽高比:1:1(正方形)、16:9(主图/横幅)、4:3(演示文稿)、9:16(移动端/故事)、3:4(肖像)
分辨率:1MP(默认)或 4MP(提高细节以实现照片级真实感,增加约 30 秒延迟)
高级:要对生成进行精确、确定性的控制,请使用 VGL 结构化提示 而不是自然语言。VGL 将每个视觉属性(对象、光照、构图)定义为显式的 JSON。
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.3" \
-d '{"image": "https://..."}'
返回带有透明度的 PNG。
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.3" \
-d '{
"images": ["https://..."],
"instruction": "change the mug to red"
}'
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.3" \
-d '{
"image": "https://...",
"mask": "https://...",
"prompt": "what to generate in masked area"
}'
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.3" \
-d '{
"image": "base64-or-url",
"aspect_ratio": "16:9",
"prompt": "coffee shop background, wooden table"
}'
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.3" \
-d '{"image": "https://...", "scale": 2}'
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.3" \
-d '{
"image": "https://product-with-transparent-bg.png",
"prompt": "modern kitchen countertop, natural morning light"
}'
将一个或多个产品放置在场景中的精确坐标处。产品会自动裁剪并与场景的光照和透视相匹配。
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.3" \
-d '{
"scene": "https://scene-image-url",
"products": [
{
"image": "https://product-image-url",
"coordinates": {"x": 100, "y": 200, "width": 300, "height": 400}
}
]
}'
所有端点都返回异步响应:
{
"request_id": "uuid",
"status_url": "https://engine.prod.bria-api.com/v2/status/uuid"
}
轮询 status_url 直到 status: "COMPLETED",然后获取 result.image_url。
import requests, time
def get_result(status_url, api_key):
headers = {"api_token": api_key, "User-Agent": "BriaSkills/1.2.3"}
while True:
r = requests.get(status_url, headers=headers)
data = r.json()
if data["status"] == "COMPLETED":
return data["result"]["image_url"]
if data["status"] == "FAILED":
raise Exception(data.get("error"))
time.sleep(2)
完整端点文档请参见 references/api-endpoints.md。
生成
| 端点 | 用途 |
|---|---|
POST /v2/image/generate | 从文本生成图像 (FIBO) |
通过文本编辑(无需遮罩)
| 端点 | 用途 |
|---|---|
POST /v2/image/edit | 使用自然语言指令编辑图像 |
POST /v2/image/edit/add_object_by_text | 向图像添加对象 |
POST /v2/image/edit/replace_object_by_text | 替换图像中的对象 |
POST /v2/image/edit/erase_by_text | 按名称移除对象 |
使用遮罩编辑
| 端点 | 用途 |
|---|---|
POST /v2/image/edit/gen_fill | 在遮罩区域内修复/生成 |
POST /v2/image/edit/erase | 擦除遮罩区域 |
背景操作
| 端点 | 用途 |
|---|---|
POST /v2/image/edit/remove_background | 移除背景 (RMBG-2.0) |
POST /v2/image/edit/replace_background | 替换为 AI 生成的背景 |
POST /v2/image/edit/blur_background | 对背景应用模糊 |
POST /v2/image/edit/erase_foreground | 移除前景,填充背景 |
POST /v2/image/edit/crop_foreground | 围绕主体紧密裁剪 |
图像变换
| 端点 | 用途 |
|---|---|
POST /v2/image/edit/expand | 外部绘制到新的宽高比 |
POST /v2/image/edit/enhance | 增强质量和细节 |
POST /v2/image/edit/increase_resolution | 放大 2 倍或 4 倍 |
POST /v2/image/edit/blend | 混合/合并图像或纹理 |
POST /v2/image/edit/reseason | 更改季节/天气 |
POST /v2/image/edit/restyle | 变换艺术风格 |
POST /v2/image/edit/relight | 修改光照 |
修复
| 端点 | 用途 |
|---|---|
POST /v2/image/edit/sketch_to_colored_image | 将草图转换为照片 |
POST /v2/image/edit/restore | 修复老旧/损坏的照片 |
POST /v2/image/edit/colorize | 为黑白照片着色或转换为黑白 |
产品摄影
| 端点 | 用途 |
|---|---|
POST /v1/product/lifestyle_shot_by_text | 通过文本将产品置于场景中 |
POST /image/edit/product/integrate | 将产品集成到场景中的精确坐标 |
实用工具
| 端点 | 用途 |
|---|---|
POST /v2/structured_instruction/generate | 生成 JSON 指令(无图像) |
GET /v2/status/{id} | 检查异步请求状态 |
所有请求都需要以下请求头:
api_token: YOUR_BRIA_API_KEY
User-Agent: BriaSkills/<version>
必需: 在每个 Bria API 调用中始终包含
User-Agent: BriaSkills/<version>请求头(其中<version>是当前技能版本,例如BriaSkills/1.2.3)。这适用于所有请求,包括状态轮询。
每周安装次数
34
代码仓库
GitHub 星标数
48
首次出现
2026年2月8日
安全审计
安装于
codex32
opencode31
gemini-cli31
github-copilot31
amp31
kimi-cli31
Generate and precisely control visual assets using Bria's commercially-safe AI models (FIBO, RMBG-2.0, GenFill, and more). 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, and chain operations in pipelines.
Before making any Bria API call, check for the API key and help the user set it up if missing:
echo $BRIA_API_KEY
If the output is not empty , skip to the next section.
Open the Bria API keys page in the browser:
open "https://platform.bria.ai/console/account/api-keys?utm_source=skill&utm_campaign=bria_skills&utm_content=adjust_photoshop_for_agent" # macOS
# xdg-open "https://platform.bria.ai/console/account/api-keys?utm_source=skill&utm_campaign=bria_skills&utm_content=adjust_photoshop_for_agent" # Linux
Then tell the user exactly this:
I opened the Bria website in your browser. To use image generation, you need a free API key.
- Sign up or log in on the page I just opened
- Click Create API Key
- Copy the key and paste it here
Wait for the user to provide their API key. Do not proceed until they give you the key.
Once the user provides the key, save it so it persists across sessions.
On macOS/Linux , detect the shell and append to the correct profile:
# Detect the shell profile
if [ -n "$ZSH_VERSION" ] || [ "$SHELL" = */zsh ]; then
PROFILE_FILE="$HOME/.zshrc"
elif [ -f "$HOME/.bashrc" ]; then
PROFILE_FILE="$HOME/.bashrc"
else
PROFILE_FILE="$HOME/.profile"
fi
# Append the export (only if not already present)
grep -q 'export BRIA_API_KEY=' "$PROFILE_FILE" 2>/dev/null && \
sed -i.bak '/export BRIA_API_KEY=/d' "$PROFILE_FILE"
echo 'export BRIA_API_KEY="THE_KEY_THE_USER_GAVE_YOU"' >> "$PROFILE_FILE"
# Make it available immediately in this session
export BRIA_API_KEY="THE_KEY_THE_USER_GAVE_YOU"
On Windows (PowerShell) :
[System.Environment]::SetEnvironmentVariable("BRIA_API_KEY", "THE_KEY_THE_USER_GAVE_YOU", "User")
$env:BRIA_API_KEY = "THE_KEY_THE_USER_GAVE_YOU"
Replace THE_KEY_THE_USER_GAVE_YOU with the actual key the user provided.
echo $BRIA_API_KEY
Confirm the key is set, then tell the user:
Your API key is saved and will persist across sessions. You're all set!
Do not proceed with any image generation or editing until the API key is confirmed set.
| Need | Capability | Use Case |
|---|---|---|
| Create new images | FIBO Generate | Hero images, product shots, illustrations |
| Edit by text | FIBO-Edit | Change colors, modify objects, transform scenes |
| Edit 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 |
| Transparent backgrounds | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |
| Background operations | Replace/Blur/Erase | Change, blur, or remove backgrounds |
| Expand images | Outpainting | Extend boundaries, change aspect ratios |
| Upscale images | Super Resolution | Increase resolution 2x or 4x |
| Enhance quality |
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.3" \
-d '{
"prompt": "your description",
"aspect_ratio": "16:9",
"resolution": "1MP"
}'
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)
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.
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.3" \
-d '{"image": "https://..."}'
Returns PNG with transparency.
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.3" \
-d '{
"images": ["https://..."],
"instruction": "change the mug to red"
}'
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.3" \
-d '{
"image": "https://...",
"mask": "https://...",
"prompt": "what to generate in masked area"
}'
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.3" \
-d '{
"image": "base64-or-url",
"aspect_ratio": "16:9",
"prompt": "coffee shop background, wooden table"
}'
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.3" \
-d '{"image": "https://...", "scale": 2}'
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.3" \
-d '{
"image": "https://product-with-transparent-bg.png",
"prompt": "modern kitchen countertop, natural morning light"
}'
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.3" \
-d '{
"scene": "https://scene-image-url",
"products": [
{
"image": "https://product-image-url",
"coordinates": {"x": 100, "y": 200, "width": 300, "height": 400}
}
]
}'
All endpoints return async responses:
{
"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):
headers = {"api_token": api_key, "User-Agent": "BriaSkills/1.2.3"}
while True:
r = requests.get(status_url, headers=headers)
data = r.json()
if data["status"] == "COMPLETED":
return data["result"]["image_url"]
if data["status"] == "FAILED":
raise Exception(data.get("error"))
time.sleep(2)
See references/api-endpoints.md for complete endpoint documentation.
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 |
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 | Place product in scene 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 |
All requests need these headers:
api_token: YOUR_BRIA_API_KEY
User-Agent: BriaSkills/<version>
Required: Always include the
User-Agent: BriaSkills/<version>header in every Bria API call (where<version>is the current skill version, e.g.BriaSkills/1.2.3). This applies to all requests including status polling.
Weekly Installs
34
Repository
GitHub Stars
48
First Seen
Feb 8, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
codex32
opencode31
gemini-cli31
github-copilot31
amp31
kimi-cli31
AI界面设计评审工具 - 全面评估UI/UX设计质量、检测AI生成痕迹与优化用户体验
58,500 周安装
学术评估工具 | ScholarEval框架:系统评估研究论文、文献综述与学术写作质量
70 周安装
豆包水印去除工具 - Python脚本一键移除豆包AI生成水印,支持批量处理
45 周安装
Salesforce B2C Commerce Page Designer开发指南:创建自定义页面与组件类型
70 周安装
AI研究综合器:多源信息整合与矛盾解决工具,生成结构化研究报告
70 周安装
API设计最佳实践指南:RESTful原则、命名规范与错误处理
70 周安装
Atlassian管理员专家:Jira/Confluence云与数据中心管理、用户安全与集成配置
71 周安装
| Enhancement |
| Improve lighting, colors, details |
| Transform style | Restyle | Oil painting, anime, cartoon, 3D render |
| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |
| Change season | Reseason | Spring, summer, autumn, winter |
| Blend/composite | Image Blending | Apply textures, logos, merge images |
| Restore photos | Restoration | Fix old/damaged photos |
| Colorize | Colorization | Add color to B&W, or convert to B&W |
| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |
| Product photography | Lifestyle Shot | Place products in scenes |
| Product integration | Product Integrate | Embed products into scenes at exact coordinates |
| Transform artistic style |
POST /v2/image/edit/relight | Modify lighting |