{"id":"d66a73bd-4699-49fc-b2f7-492aef5270c3","entityType":"agent","slug":"clawhub-galbria-bria-ai-api","name":"Bria Ai API Client","canonicalUrl":"https://www.xpersona.co/agent/clawhub-galbria-bria-ai-api","canonicalPath":"/agent/clawhub-galbria-bria-ai-api","generatedAt":"2026-10-09T11:12:55.215Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"description":"Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images. Skill: Bria Ai API Client Owner: galbria Summary: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images. Tags: latest:0.0.1 Versio","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 4/15/2026.","installCommand":"clawhub skill install kn7artjmk0ncb5fmp9x21x4tss80jshr:bria-ai-api","sourceUrl":"https://clawhub.ai/galbria/bria-ai-api","homepage":"https://clawhub.ai/galbria/bria-ai-api","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/galbria/bria-ai-api","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipe"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"stars":null,"forks":null,"downloads":1021,"packageName":null,"latestVersion":"0.0.1","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-03-01T00:49:11.828Z","emptyReason":null},"lastUpdatedAt":"2026-04-15T00:45:39.800Z","lastCrawledAt":"2026-03-01T00:49:11.828Z","lastIndexedAt":null,"nextCrawlAt":"2026-03-02T00:49:11.828Z","lastVerifiedAt":null,"highlights":[{"version":"0.0.1","createdAt":"2026-02-05T17:52:45.752Z","changelog":"Initial release. - Provides detailed documentation for all Bria.ai visual asset generation features. - Includes example API calls for common workflows: image generation, editing, background removal, upscaling, and lifestyle product shots. - Covers use cases for websites, presentations, e-commerce, marketing, and social media assets. - Offers prompt engineering tips and practical guidance for high-quality results. - Defines supported aspect ratios and includes sample prompts for various image types.","fileCount":8,"zipByteSize":29822},{"version":"0.1.0","createdAt":"2026-02-05T17:51:27.313Z","changelog":"Initial release of bria-ai skill for generating and editing images with Bria.ai. - Generate production-ready images for websites, e-commerce, presentations, and more - Supports batch image generation and pipeline workflows (generate → edit → remove background) - Includes advanced editing (text-based, masked, inpainting, background operations, upscaling, style transformation) - Quick reference examples for common API operations and use cases - Detailed workflow guides for hero images, product shots, presentation visuals, and more","fileCount":8,"zipByteSize":29821}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install kn7artjmk0ncb5fmp9x21x4tss80jshr:bria-ai-api","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T11:12:55.214Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai-api/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"readme":"Skill: Bria Ai API Client\n\nOwner: galbria\n\nSummary: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images.\n\nTags: latest:0.0.1\n\nVersion history:\n\nv0.0.1 | 2026-02-05T17:52:45.752Z | user\n\nInitial release.\n\n- Provides detailed documentation for all Bria.ai visual asset generation features.\n- Includes example API calls for common workflows: image generation, editing, background removal, upscaling, and lifestyle product shots.\n- Covers use cases for websites, presentations, e-commerce, marketing, and social media assets.\n- Offers prompt engineering tips and practical guidance for high-quality results.\n- Defines supported aspect ratios and includes sample prompts for various image types.\n\nv0.1.0 | 2026-02-05T17:51:27.313Z | auto\n\nInitial release of bria-ai skill for generating and editing images with Bria.ai.\n\n- Generate production-ready images for websites, e-commerce, presentations, and more\n- Supports batch image generation and pipeline workflows (generate → edit → remove background)\n- Includes advanced editing (text-based, masked, inpainting, background operations, upscaling, style transformation)\n- Quick reference examples for common API operations and use cases\n- Detailed workflow guides for hero images, product shots, presentation visuals, and more\n\nArchive index:\n\nArchive v0.0.1: 8 files, 29822 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (9849b), references/code-examples/bria_client.py (21547b), references/code-examples/bria_client.sh (19668b), references/code-examples/bria_client.ts (20620b), references/guide.md (16535b), SKILL.md (21357b), _meta.json (130b)\n\nFile v0.0.1:SKILL.md\n\n---\nname: bria-ai\ndescription: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images.\n---\n\n# Bria Visual Asset Generator\n\nGenerate production-ready visual assets for websites, presentations, documents, and applications using Bria's commercially-safe AI models.\n\n## When to Use This Skill\n\n- **Website/App Development**: Hero images, product photos, backgrounds, illustrations\n- **Presentations**: Slides visuals, diagrams, icons, cover images\n- **Documents**: Report graphics, infographics, headers, decorative elements\n- **Marketing**: Social media assets, banners, promotional images\n- **E-commerce**: Product photography, lifestyle shots, catalog images\n- **Batch Generation**: Multiple images with different prompts concurrently\n- **Pipeline Workflows**: Chained operations (generate → edit → remove background → lifestyle shot)\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Create new images | FIBO Generate | Hero images, product shots, illustrations |\n| Edit by text | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Transparent backgrounds | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Background operations | Replace/Blur/Erase | Change, blur, or remove backgrounds |\n| Expand images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale images | Super Resolution | Increase resolution 2x or 4x |\n| Enhance quality | Enhancement | Improve lighting, colors, details |\n| Transform style | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Blend/composite | Image Blending | Apply textures, logos, merge images |\n| Text replacement | Rewrite | Change text in images |\n| Restore photos | Restoration | Fix old/damaged photos |\n| Colorize | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Product photography | Lifestyle Shot | Place products in scenes |\n\n## Quick Reference\n\n### Generate an Image (FIBO)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\"\n  }'\n```\n\n**Aspect ratios**: `1:1` (square), `16:9` (hero/banner), `4:3` (presentation), `9:16` (mobile/story), `3:4` (portrait)\n\n> **Advanced**: For precise, deterministic control over generation, use **[VGL structured prompts](../vgl/SKILL.md)** instead of natural language. VGL defines every visual attribute (objects, lighting, composition) as explicit JSON.\n\n### Remove Background (RMBG-2.0)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image\": \"https://...\"}'\n```\n\nReturns PNG with transparency.\n\n### Edit Image (FIBO-Edit) - No Mask Required\n\nEdit any image with natural language instructions:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"images\": [\"https://...\"],\n    \"instruction\": \"change the mug to red\"\n  }'\n```\n\n**Python example:**\n```python\nfrom bria_client import BriaClient\nclient = BriaClient()\nresult = client.edit_image(image_url, \"change the mug to red\")\nprint(result['result']['image_url'])\n```\n\n### Edit Image Region with Mask (FIBO-Edit)\n\nFor precise control over which region to edit:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/gen_fill\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"https://...\",\n    \"mask\": \"https://...\",\n    \"prompt\": \"what to generate in masked area\"\n  }'\n```\n\n### Expand Image (Outpainting)\n\nExtend image boundaries to new aspect ratio:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/expand\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"base64-or-url\",\n    \"aspect_ratio\": \"16:9\",\n    \"prompt\": \"coffee shop background, wooden table\"\n  }'\n```\n\n### Upscale Image\n\nIncrease image resolution 2x or 4x:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/increase_resolution\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image\": \"https://...\", \"scale\": 2}'\n```\n\n### Product Lifestyle Shot\n\nPlace a product in a lifestyle scene:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/lifestyle_shot_by_text\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"https://product-with-transparent-bg.png\",\n    \"prompt\": \"modern kitchen countertop, natural morning light\"\n  }'\n```\n\n---\n\n## Asset Generation Workflows\n\n### Website Hero Images\n\nGenerate wide banner images for landing pages:\n\n```json\n{\n  \"prompt\": \"Modern tech startup workspace with developers collaborating, bright natural lighting, clean minimal aesthetic\",\n  \"aspect_ratio\": \"16:9\",\n  \"negative_prompt\": \"cluttered, dark, low quality\"\n}\n```\n\n**Tips for hero images:**\n- Use `16:9` for full-width banners\n- Describe lighting and mood explicitly\n- Include \"professional\", \"high quality\", \"commercial\" for polished results\n- Specify \"clean background\" or \"minimal\" for text overlay space\n\n### Product Photography\n\nGenerate e-commerce style product shots:\n\n```json\n{\n  \"prompt\": \"Professional product photo of [item] on white studio background, soft shadows, commercial photography lighting\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\n**Then remove background** for transparent PNG to composite anywhere:\n\n```json\n{\"image\": \"generated_image_url\"}\n```\n\n### Presentation Visuals\n\nGenerate slides-ready images:\n\n```json\n{\n  \"prompt\": \"Abstract visualization of data analytics, blue and purple gradient, modern corporate style, clean composition with space for text\",\n  \"aspect_ratio\": \"16:9\"\n}\n```\n\n**Common presentation themes:**\n- \"Abstract technology background\" - tech slides\n- \"Business team collaboration\" - culture slides\n- \"Growth chart visualization\" - metrics slides\n- \"Minimalist geometric patterns\" - section dividers\n\n### Document Graphics\n\nGenerate report or article images:\n\n```json\n{\n  \"prompt\": \"Isometric illustration of cloud computing infrastructure, flat design, vibrant colors, white background\",\n  \"aspect_ratio\": \"4:3\"\n}\n```\n\n### Icons and Illustrations\n\nFor icons, generate then remove background:\n\n```json\n{\n  \"prompt\": \"3D icon of a shield with checkmark, glossy material, soft gradient background, app icon style\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\nThen use RMBG-2.0 to get transparent PNG.\n\n### Social Media Assets\n\n**Instagram post (1:1):**\n```json\n{\n  \"prompt\": \"Lifestyle photo of coffee and laptop on wooden desk, morning light, cozy atmosphere\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\n**Story/Reel (9:16):**\n```json\n{\n  \"prompt\": \"Vertical product showcase of smartphone, floating in gradient background, tech aesthetic\",\n  \"aspect_ratio\": \"9:16\"\n}\n```\n\n---\n\n## Prompt Engineering Tips\n\n### Be Specific About Style\n- \"professional product photography\" vs \"casual snapshot\"\n- \"flat design illustration\" vs \"3D rendered\"\n- \"corporate modern\" vs \"playful colorful\"\n\n### Specify Technical Details\n- Lighting: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- Background: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- Composition: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n\n### Quality Keywords\nAdd these for polished results:\n- \"high quality\", \"professional\", \"commercial grade\"\n- \"4K\", \"detailed\", \"sharp focus\"\n- \"award-winning photography\" (for photos)\n\n### Negative Prompts\nExclude unwanted elements:\n- \"blurry, low quality, pixelated\"\n- \"text, watermark, logo\"\n- \"cluttered, busy, messy\"\n\n---\n\n## Async Response Handling\n\nAll endpoints return async responses:\n\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\nPoll the status_url until `status: \"COMPLETED\"`, then get `result.image_url`.\n\n```python\nimport requests, time\n\ndef get_result(status_url, api_key):\n    while True:\n        r = requests.get(status_url, headers={\"api_token\": api_key})\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n```\n\n---\n\n## Batch & Parallel Image Generation\n\n### Generating Multiple Images Concurrently\n\nFor generating many images efficiently, launch requests in parallel and poll concurrently:\n\n```python\nimport asyncio\nimport aiohttp\n\nasync def generate_image(session, api_key, prompt, aspect_ratio=\"1:1\"):\n    \"\"\"Launch a single generation request.\"\"\"\n    async with session.post(\n        \"https://engine.prod.bria-api.com/v2/image/generate\",\n        headers={\"api_token\": api_key, \"Content-Type\": \"application/json\"},\n        json={\"prompt\": prompt, \"aspect_ratio\": aspect_ratio}\n    ) as resp:\n        return await resp.json()\n\nasync def poll_status(session, api_key, status_url, timeout=120):\n    \"\"\"Poll until complete or failed.\"\"\"\n    for _ in range(timeout // 2):\n        async with session.get(status_url, headers={\"api_token\": api_key}) as resp:\n            data = await resp.json()\n            if data[\"status\"] == \"COMPLETED\":\n                return data[\"result\"][\"image_url\"]\n            if data[\"status\"] == \"FAILED\":\n                raise Exception(data.get(\"error\", \"Generation failed\"))\n        await asyncio.sleep(2)\n    raise TimeoutError(f\"Timeout polling {status_url}\")\n\nasync def generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=5):\n    \"\"\"Generate multiple images with different prompts concurrently.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)  # Rate limiting\n\n    async def generate_one(prompt):\n        async with semaphore:\n            async with aiohttp.ClientSession() as session:\n                # Launch request\n                result = await generate_image(session, api_key, prompt, aspect_ratio)\n                # Poll for completion\n                return await poll_status(session, api_key, result[\"status_url\"])\n\n    # Run all concurrently\n    results = await asyncio.gather(*[generate_one(p) for p in prompts], return_exceptions=True)\n    return results\n\n# Usage\nprompts = [\n    \"Professional photo of running shoes on white background\",\n    \"Professional photo of leather handbag on white background\",\n    \"Professional photo of smartwatch on white background\",\n    \"Professional photo of sunglasses on white background\",\n]\nimage_urls = asyncio.run(generate_batch(\"YOUR_API_KEY\", prompts, max_concurrent=3))\n```\n\n**Key points:**\n- Use `asyncio.Semaphore` to limit concurrent requests (recommended: 3-5)\n- `return_exceptions=True` prevents one failure from canceling all requests\n- Each result is either a URL string or an Exception object\n\n### TypeScript/Node.js Parallel Generation\n\n```typescript\ntype AspectRatio = \"1:1\" | \"4:3\" | \"16:9\" | \"3:4\" | \"9:16\";\n\ninterface BriaResponse {\n  request_id: string;\n  status_url: string;\n}\n\ninterface BriaStatusResponse {\n  status: \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\";\n  result?: { image_url: string };\n  error?: string;\n}\n\ninterface GenerateBatchResult {\n  prompt: string;\n  imageUrl: string | null;\n  error: string | null;\n}\n\nasync function generateBatch(\n  apiKey: string,\n  prompts: string[],\n  aspectRatio: AspectRatio = \"1:1\",\n  maxConcurrent = 5\n): Promise<GenerateBatchResult[]> {\n  const semaphore = { count: 0, max: maxConcurrent };\n\n  async function withLimit<T>(fn: () => Promise<T>): Promise<T> {\n    while (semaphore.count >= semaphore.max) {\n      await new Promise(r => setTimeout(r, 100));\n    }\n    semaphore.count++;\n    try {\n      return await fn();\n    } finally {\n      semaphore.count--;\n    }\n  }\n\n  async function generateOne(prompt: string): Promise<string> {\n    return withLimit(async () => {\n      // Launch request\n      const res = await fetch(\"https://engine.prod.bria-api.com/v2/image/generate\", {\n        method: \"POST\",\n        headers: { \"api_token\": apiKey, \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ prompt, aspect_ratio: aspectRatio })\n      });\n      const { status_url } = (await res.json()) as BriaResponse;\n\n      // Poll for result\n      for (let i = 0; i < 60; i++) {\n        const statusRes = await fetch(status_url, { headers: { \"api_token\": apiKey } });\n        const data = (await statusRes.json()) as BriaStatusResponse;\n        if (data.status === \"COMPLETED\") return data.result!.image_url;\n        if (data.status === \"FAILED\") throw new Error(data.error || \"Generation failed\");\n        await new Promise(r => setTimeout(r, 2000));\n      }\n      throw new Error(\"Timeout waiting for generation\");\n    });\n  }\n\n  const results = await Promise.allSettled(prompts.map(generateOne));\n\n  return results.map((result, i) => ({\n    prompt: prompts[i],\n    imageUrl: result.status === \"fulfilled\" ? result.value : null,\n    error: result.status === \"rejected\" ? result.reason.message : null\n  }));\n}\n\n// Usage\nconst results = await generateBatch(process.env.BRIA_API_KEY!, [\n  \"Modern office workspace with natural lighting\",\n  \"Abstract tech background with blue gradient\",\n  \"Professional headshot studio setup\"\n], \"16:9\", 3);\n\nresults.forEach(r => {\n  if (r.imageUrl) console.log(`✓ ${r.prompt}: ${r.imageUrl}`);\n  else console.log(`✗ ${r.prompt}: ${r.error}`);\n});\n```\n```\n\n---\n\n## Pipeline Workflows\n\nChain multiple operations on images (generate → edit → remove background).\n\n### Complete Pipeline Example\n\n```python\nasync def product_pipeline(api_key, product_descriptions, scene_prompt):\n    \"\"\"\n    Pipeline: Generate product → Remove background → Place in lifestyle scene\n    \"\"\"\n    async with aiohttp.ClientSession() as session:\n        results = []\n\n        for desc in product_descriptions:\n            # Step 1: Generate product image\n            gen_result = await generate_image(session, api_key,\n                f\"Professional product photo of {desc} on white background, studio lighting\",\n                aspect_ratio=\"1:1\")\n            product_url = await poll_status(session, api_key, gen_result[\"status_url\"])\n\n            # Step 2: Remove background\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\"},\n                json={\"image\": product_url}\n            ) as resp:\n                rmbg_result = await resp.json()\n            transparent_url = await poll_status(session, api_key, rmbg_result[\"status_url\"])\n\n            # Step 3: Place in lifestyle scene\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/lifestyle_shot_by_text\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\"},\n                json={\"image\": transparent_url, \"prompt\": scene_prompt}\n            ) as resp:\n                lifestyle_result = await resp.json()\n            final_url = await poll_status(session, api_key, lifestyle_result[\"status_url\"])\n\n            results.append({\n                \"product\": desc,\n                \"original\": product_url,\n                \"transparent\": transparent_url,\n                \"lifestyle\": final_url\n            })\n\n        return results\n\n# Usage\nproducts = [\"coffee mug\", \"water bottle\", \"notebook\"]\nscene = \"modern minimalist desk, natural morning light, plants in background\"\nresults = asyncio.run(product_pipeline(\"YOUR_API_KEY\", products, scene))\n```\n\n### Parallel Pipeline (Advanced)\n\nProcess multiple products through the pipeline concurrently:\n\n```python\nasync def parallel_pipeline(api_key, products, scene_prompt, max_concurrent=3):\n    \"\"\"Run full pipeline for multiple products in parallel.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)\n\n    async def process_one(product):\n        async with semaphore:\n            return await single_product_pipeline(api_key, product, scene_prompt)\n\n    return await asyncio.gather(*[process_one(p) for p in products], return_exceptions=True)\n```\n\n### Common Pipeline Patterns\n\n| Pipeline | Steps | Use Case |\n|----------|-------|----------|\n| Product → Transparent | generate → remove_background | E-commerce cutouts |\n| Product → Lifestyle | generate → remove_background → lifestyle_shot | Marketing photos |\n| Edit → Upscale | edit → increase_resolution | High-res edited images |\n| Generate → Restyle | generate → restyle | Artistic variations |\n| Generate → Variations | generate (num_results=4) | A/B testing options |\n\n---\n\n## Integration Examples\n\n### React/Next.js Component\n\n```jsx\n// Generate and display a hero image\nconst [imageUrl, setImageUrl] = useState(null);\n\nasync function generateHero(prompt) {\n  const res = await fetch('/api/bria/generate', {\n    method: 'POST',\n    body: JSON.stringify({ prompt, aspect_ratio: '16:9' })\n  });\n  const { image_url } = await res.json();\n  setImageUrl(image_url);\n}\n```\n\n### Python Script for Batch Generation\n\n```python\nimport asyncio\n\n# See \"Batch & Parallel Image Generation\" section for generate_batch function\n\nasync def main():\n    api_key = \"YOUR_API_KEY\"\n    products = [\"running shoes\", \"leather bag\", \"smart watch\"]\n    prompts = [f\"Professional product photo of {p} on white background\" for p in products]\n\n    results = await generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=3)\n\n    for product, result in zip(products, results):\n        if isinstance(result, Exception):\n            print(f\"{product}: FAILED - {result}\")\n        else:\n            print(f\"{product}: {result}\")\n\nasyncio.run(main())\n```\n\n---\n\n## API Reference\n\nSee `references/api-endpoints.md` for complete endpoint documentation.\n\n### Key Endpoints\n\n**Generation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/generate` | Generate images from text (FIBO) |\n\n**Edit by Text (No Mask)**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit` | Edit image with natural language instruction |\n| `POST /v2/image/edit/add_object_by_text` | Add objects to image |\n| `POST /v2/image/edit/replace_object_by_text` | Replace objects in image |\n| `POST /v2/image/edit/erase_by_text` | Remove objects by name |\n\n**Edit with Mask**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/gen_fill` | Inpaint/generate in masked region |\n| `POST /v2/image/edit/erase` | Erase masked region |\n\n**Background Operations**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/remove_background` | Remove background (RMBG-2.0) |\n| `POST /v2/image/edit/replace_background` | Replace with AI-generated background |\n| `POST /v2/image/edit/blur_background` | Apply blur to background |\n| `POST /v2/image/edit/erase_foreground` | Remove foreground, fill background |\n| `POST /v2/image/edit/crop_foreground` | Crop tightly around subject |\n\n**Image Transformation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/expand` | Outpaint to new aspect ratio |\n| `POST /v2/image/edit/enhance` | Enhance quality and details |\n| `POST /v2/image/edit/increase_resolution` | Upscale 2x or 4x |\n| `POST /v2/image/edit/blend` | Blend/merge images or textures |\n| `POST /v2/image/edit/reseason` | Change season/weather |\n| `POST /v2/image/edit/restyle` | Transform artistic style |\n| `POST /v2/image/edit/relight` | Modify lighting |\n\n**Text & Restoration**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/replace_text` | Replace text in image |\n| `POST /v2/image/edit/sketch_to_image` | Convert sketch to photo |\n| `POST /v2/image/edit/restore` | Restore old/damaged photos |\n| `POST /v2/image/edit/colorize` | Colorize B&W or convert to B&W |\n\n**Product Photography**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/lifestyle_shot_by_text` | Place product in scene by text |\n| `POST /v2/image/edit/shot_by_image` | Place product on reference background |\n\n**Utilities**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/structured_instruction/generate` | Generate JSON instruction (no image) |\n| `GET /v2/status/{id}` | Check async request status |\n\n### Authentication\n\nAll requests need `api_token` header:\n```\napi_token: YOUR_BRIA_API_KEY\n```\n\n---\n\n## Related Skills\n\n- **[vgl](../vgl/SKILL.md)** - Write structured VGL (Visual Generation Language) JSON prompts for precise, deterministic control over FIBO image generation. Use VGL for reproducible outputs with explicit visual attributes.\n- **[image-utils](../image-utils/SKILL.md)** - Classic image manipulation (resize, crop, composite, watermarks) for post-processing Bria outputs\n\nFile v0.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai-api\",\n  \"version\": \"0.0.1\",\n  \"publishedAt\": 1770313965752\n}\n\nFile v0.0.1:references/api-endpoints.md\n\n# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include `api_token` header in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\n```\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required | Image description |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement) |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to generate in masked area |\n| `mask_type` | string | \"manual\" | \"manual\" or \"automatic\" |\n| `negative_prompt` | string | - | What to avoid |\n| `num_results` | int | 1 | Number of variations |\n\n**Mask Requirements:**\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n- Same aspect ratio as source image\n\n### POST /v2/image/edit/erase\n\nRemove objects defined by mask.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\"\n}\n```\n\n### POST /v2/image/edit/erase_foreground\n\nRemove primary subject and fill with background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/replace_background\n\nReplace background with AI-generated content.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"prompt\": \"new background description\"\n}\n```\n\n### POST /v2/image/edit/blur_background\n\nApply blur effect to image background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/expand\n\nExpand/outpaint an image to extend its boundaries.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-string-or-url\",\n  \"aspect_ratio\": \"16:9\",\n  \"prompt\": \"optional description for new content\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 string |\n| `aspect_ratio` | string | required | Target ratio: \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `prompt` | string | - | Optional - describe content to generate |\n\n### POST /v2/image/edit/enhance\n\nEnhance image quality (lighting, colors, details).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/increase_resolution\n\nUpscale image resolution.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"scale\": 2\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `scale` | int | 2 | Upscale factor (2 or 4) |\n\n### POST /v2/image/edit/lifestyle_shot_by_text\n\nPlace a product in a lifestyle scene using text description.\n\n**Request:**\n```json\n{\n  \"image\": \"https://product-image-url\",\n  \"prompt\": \"modern kitchen countertop, natural lighting\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n### POST /v2/image/edit/shot_by_image\n\nPlace a product on a reference background image.\n\n**Request:**\n```json\n{\n  \"image\": \"https://product-image-url\",\n  \"background\": \"https://background-image-url\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n---\n\n## Text-Based Object Editing\n\n### POST /v2/image/edit/add_object_by_text\n\nAdd a new object to an image using natural language.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Place a red vase with flowers on the table\"\n}\n```\n\n### POST /v2/image/edit/replace_object_by_text\n\nReplace an existing object with a new one.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Replace the red apple with a green pear\"\n}\n```\n\n### POST /v2/image/edit/erase_by_text\n\nRemove a specific object by name.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"object_name\": \"table\"\n}\n```\n\n---\n\n## Image Transformation\n\n### POST /v2/image/edit/blend\n\nBlend/merge images or apply textures.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"overlay\": \"texture-or-art-url\",\n  \"instruction\": \"Place the art on the shirt, keep the art exactly the same\"\n}\n```\n\n### POST /v2/image/edit/reseason\n\nChange the season or weather of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"season\": \"winter\"\n}\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### POST /v2/image/edit/restyle\n\nTransform the artistic style of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"oil_painting\"\n}\n```\n\n**Style IDs:** `render_3d`, `cubism`, `oil_painting`, `anime`, `cartoon`, `coloring_book`, `retro_ad`, `pop_art_halftone`, `vector_art`, `story_board`, `art_nouveau`, `cross_etching`, `wood_cut`\n\n### POST /v2/image/edit/relight\n\nModify the lighting setup of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"light_type\": \"spotlight on subject, keep background settings\"\n}\n```\n\n---\n\n## Text in Images\n\n### POST /v2/image/edit/replace_text\n\nReplace existing text in an image with new text.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"new_text\": \"FIBO Edit!\"\n}\n```\n\n---\n\n## Image Restoration & Conversion\n\n### POST /v2/image/edit/sketch_to_image\n\nConvert a sketch or line drawing to a photorealistic image.\n\n**Request:**\n```json\n{\n  \"image\": \"sketch-base64-or-url\",\n  \"prompt\": \"optional description\"\n}\n```\n\n### POST /v2/image/edit/restore\n\nRestore old/damaged photos by removing noise, scratches, and blur.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n### POST /v2/image/edit/colorize\n\nAdd color to B&W photos or convert to B&W.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"color_contemporary\"\n}\n```\n\n**Styles:** `color_contemporary`, `bw`\n\n### POST /v2/image/edit/crop_foreground\n\nRemove background and crop tightly around the foreground.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n---\n\n## Structured Instructions\n\n### POST /v2/structured_instruction/generate\n\nGenerate a structured JSON instruction from natural language (no image generated).\n\n**Request:**\n```json\n{\n  \"images\": [\"base64-or-url\"],\n  \"instruction\": \"change to golden hour lighting\",\n  \"mask\": \"optional-mask-url\"\n}\n```\n\n**Returns:** `structured_instruction` JSON that can be passed to `/v2/image/edit`\n\n---\n\n## Status Polling\n\n### GET /v2/status/{request_id}\n\nCheck async request status.\n\n**Response:**\n```json\n{\n  \"status\": \"IN_PROGRESS | COMPLETED | FAILED\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  },\n  \"request_id\": \"uuid\"\n}\n```\n\n**Status Values:**\n- `IN_PROGRESS` - Still processing\n- `COMPLETED` - Success, result available\n- `FAILED` - Error occurred\n\n**Polling Pattern:**\n```python\nimport requests, time\n\ndef poll(status_url, api_key, timeout=120):\n    for _ in range(timeout // 2):\n        r = requests.get(status_url, headers={\"api_token\": api_key})\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n    raise TimeoutError()\n```\n\n---\n\n## Error Handling\n\n### HTTP Status Codes\n\n| Code | Description |\n|------|-------------|\n| 200 | Success |\n| 400 | Bad request |\n| 401 | Unauthorized - invalid API key |\n| 415 | Unsupported media type |\n| 422 | Validation failed / Content moderation blocked |\n| 429 | Rate limited |\n| 500 | Server error |\n\n### Supported Image Formats\n\n- **Input:** JPEG, JPG, PNG, WEBP (RGB, RGBA, CMYK)\n- **Output:** PNG (with transparency where applicable)\n\nFile v0.0.1:references/guide.md\n\n# Bria AI Visual Asset Generator - Complete Guide\n\nThis guide covers all capabilities of the Bria AI skill for generating and editing visual assets.\n\n## Table of Contents\n\n1. [Setup](#setup)\n2. [Image Generation (FIBO)](#image-generation-fibo)\n3. [Image Editing](#image-editing)\n4. [Text-Based Object Editing](#text-based-object-editing)\n5. [Background Operations](#background-operations)\n6. [Image Enhancement](#image-enhancement)\n7. [Image Transformation](#image-transformation)\n8. [Text & Restoration](#text--restoration)\n9. [Product Photography](#product-photography)\n10. [Best Practices](#best-practices)\n\n---\n\n## Setup\n\n### Authentication\n\nAll Bria API requests require an API key. Set it as an environment variable:\n\n```bash\nexport BRIA_API_KEY=\"your-api-key-here\"\n```\n\n### Using the Python Client\n\n```python\nfrom bria_client import BriaClient\n\nclient = BriaClient()  # Uses BRIA_API_KEY env var\n# or\nclient = BriaClient(api_key=\"your-key\")\n```\n\n### Input Formats\n\nBria accepts images in two formats:\n- **URL**: Publicly accessible image URL\n- **Base64**: Raw base64 encoded string (for most edit endpoints) or data URL `data:image/png;base64,...` (for `/v2/image/edit`)\n\n---\n\n## Image Generation (FIBO)\n\nFIBO is Bria's text-to-image model that generates high-quality, commercially-safe images.\n\n### Basic Generation\n\n```python\nresult = client.generate(\n    prompt=\"Modern coffee shop interior, warm lighting, minimalist design\",\n    aspect_ratio=\"16:9\"\n)\nprint(result['result']['image_url'])\n```\n\n### Aspect Ratios\n\n| Ratio | Use Case |\n|-------|----------|\n| `1:1` | Social media posts, product photos, icons |\n| `4:3` | Presentations, documents |\n| `16:9` | Hero banners, website headers, videos |\n| `3:4` | Portrait photos, mobile content |\n| `9:16` | Stories, reels, mobile-first content |\n\n### Using Negative Prompts\n\nExclude unwanted elements:\n\n```python\nresult = client.generate(\n    prompt=\"Professional headshot, studio lighting\",\n    aspect_ratio=\"1:1\",\n    negative_prompt=\"blurry, low quality, distorted, watermark\"\n)\n```\n\n### Refining Generated Images\n\nUse the `structured_prompt` from a previous generation to make modifications:\n\n```python\n# First generation\nresult = client.generate(\"Red sports car in desert\")\nstructured_prompt = result['result']['structured_prompt']\n\n# Refine it\nrefined = client.refine(\n    structured_prompt=structured_prompt,\n    instruction=\"change to blue color, add mountains in background\",\n    aspect_ratio=\"16:9\"\n)\n```\n\n### Inspire Mode (Image-to-Image)\n\nGenerate variations based on a reference image:\n\n```python\nresult = client.inspire(\n    image_url=\"https://example.com/reference.jpg\",\n    prompt=\"same style but with autumn colors\",\n    aspect_ratio=\"1:1\"\n)\n```\n\n---\n\n## Image Editing\n\n### Edit by Instruction (No Mask Required)\n\nThe simplest way to edit - just describe what you want to change:\n\n```python\nresult = client.edit_image(\n    image_url=\"data:image/png;base64,{base64_string}\",\n    instruction=\"change the mug color to red\"\n)\n```\n\n**Example instructions:**\n- \"make the sky more dramatic\"\n- \"change the car to silver\"\n- \"add sunglasses to the person\"\n- \"make it look like winter\"\n\n### Edit with Mask (Precise Control)\n\nFor precise edits, use a mask to define the region:\n\n```python\nresult = client.gen_fill(\n    image_url=\"https://example.com/image.jpg\",\n    mask_url=\"https://example.com/mask.png\",  # White = edit, Black = keep\n    prompt=\"red leather armchair\",\n    mask_type=\"manual\"\n)\n```\n\n**Mask requirements:**\n- Same dimensions as source image\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n\n### Erase Objects\n\nRemove unwanted objects from an image:\n\n```python\nresult = client.erase(\n    image_url=\"https://example.com/image.jpg\",\n    mask_url=\"https://example.com/mask.png\"  # White = area to erase\n)\n```\n\n---\n\n## Text-Based Object Editing\n\nEdit images by describing what to add, replace, or remove - no mask required.\n\n### Add Object\n\nAdd new objects to an image using natural language:\n\n```python\nresult = client.add_object(\n    image_url=\"https://example.com/room.jpg\",\n    instruction=\"Place a red vase with flowers on the table\"\n)\n```\n\n**Example instructions:**\n- \"Add a laptop on the desk\"\n- \"Place a cat sleeping on the couch\"\n- \"Add a plant in the corner\"\n\n### Replace Object\n\nReplace existing objects with new ones:\n\n```python\nresult = client.replace_object(\n    image_url=\"https://example.com/fruit.jpg\",\n    instruction=\"Replace the red apple with a green pear\"\n)\n```\n\n**Example instructions:**\n- \"Replace the wooden chair with a modern office chair\"\n- \"Change the coffee mug to a wine glass\"\n- \"Replace the landscape painting with abstract art\"\n\n### Erase Object by Name\n\nRemove specific objects without needing a mask:\n\n```python\nresult = client.erase_object(\n    image_url=\"https://example.com/scene.jpg\",\n    object_name=\"table\"\n)\n```\n\n**Common removals:**\n- \"person\", \"car\", \"text\", \"watermark\"\n- \"shadow\", \"reflection\"\n- Specific objects: \"lamp\", \"chair\", \"tree\"\n\n---\n\n## Background Operations\n\n### Remove Background (RMBG-2.0)\n\nExtract subjects with transparent backgrounds:\n\n```python\nresult = client.remove_background(\"https://example.com/product.jpg\")\n# Returns PNG with transparency\n```\n\n**Use cases:**\n- Product cutouts for e-commerce\n- Logo extraction\n- Creating stickers/overlays\n- Compositing subjects into new scenes\n\n### Replace Background\n\nReplace the background with AI-generated content:\n\n```python\nresult = client.replace_background(\n    image_url=\"https://example.com/portrait.jpg\",\n    prompt=\"professional office environment, soft lighting\"\n)\n```\n\n### Blur Background\n\nApply a blur effect to the background (portrait mode):\n\n```python\nresult = client.blur_background(\"https://example.com/photo.jpg\")\n```\n\n### Erase Foreground\n\nRemove the main subject and fill with background:\n\n```python\nresult = client.erase_foreground(\"https://example.com/image.jpg\")\n```\n\n---\n\n## Image Enhancement\n\n### Expand Image (Outpainting)\n\nExtend image boundaries to a new aspect ratio:\n\n```python\n# Convert a 1:1 image to 16:9 banner\nresult = client.expand_image(\n    image_url=base64_string,\n    aspect_ratio=\"16:9\",\n    prompt=\"continue the scene with similar style\"\n)\n```\n\n**Common workflows:**\n- Square product photo → 16:9 hero banner\n- Portrait → landscape for presentations\n- Add space for text overlays\n\n### Enhance Quality\n\nImprove lighting, colors, and details:\n\n```python\nresult = client.enhance_image(base64_string)\n```\n\n### Increase Resolution (Upscale)\n\nUpscale images 2x or 4x:\n\n```python\nresult = client.increase_resolution(\n    image_url=base64_string,\n    scale=2  # or 4\n)\n```\n\n---\n\n## Image Transformation\n\nTransform the style, lighting, season, or composition of images.\n\n### Blend Images\n\nMerge images or apply textures/overlays:\n\n```python\nresult = client.blend_images(\n    image_url=\"https://example.com/tshirt.jpg\",\n    overlay_url=\"https://example.com/design.png\",\n    instruction=\"Place the art on the shirt, keep the art exactly the same\"\n)\n```\n\n**Use cases:**\n- Apply logos or designs to products\n- Add textures to surfaces\n- Composite multiple images together\n\n### Change Season (Reseason)\n\nTransform the season or weather atmosphere:\n\n```python\nresult = client.reseason(\n    image_url=\"https://example.com/landscape.jpg\",\n    season=\"winter\"  # spring, summer, autumn, winter\n)\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### Change Style (Restyle)\n\nTransform the artistic style of an image:\n\n```python\nresult = client.restyle(\n    image_url=\"https://example.com/photo.jpg\",\n    style=\"oil_painting\"\n)\n```\n\n**Available styles:**\n- `render_3d` - 3D rendered look\n- `oil_painting` - Classic oil painting\n- `anime` - Anime/manga style\n- `cartoon` - Cartoon illustration\n- `coloring_book` - Line art for coloring\n- `retro_ad` - Vintage advertisement\n- `pop_art_halftone` - Pop art with halftone dots\n- `vector_art` - Flat vector graphics\n- `story_board` - Storyboard sketch\n- `art_nouveau` - Art nouveau style\n- `cross_etching` - Cross-hatched etching\n- `wood_cut` - Woodcut print\n- `cubism` - Cubist art style\n\n### Change Lighting (Relight)\n\nModify the lighting setup of an image:\n\n```python\nresult = client.relight(\n    image_url=\"https://example.com/portrait.jpg\",\n    light_type=\"spotlight on subject, keep background settings\"\n)\n```\n\n**Lighting descriptions:**\n- \"golden hour warm lighting\"\n- \"dramatic spotlight from above\"\n- \"soft diffused studio lighting\"\n- \"neon blue and pink rim lighting\"\n\n---\n\n## Text & Restoration\n\nWork with text in images and restore old photos.\n\n### Replace Text\n\nReplace existing text in images with new text:\n\n```python\nresult = client.replace_text(\n    image_url=\"https://example.com/sign.jpg\",\n    new_text=\"SALE 50% OFF\"\n)\n```\n\n**Use cases:**\n- Update signage in photos\n- Localize marketing materials\n- Change product labels\n\n### Sketch to Image\n\nConvert sketches or line drawings to photorealistic images:\n\n```python\nresult = client.sketch_to_image(\n    image_url=\"https://example.com/sketch.png\",\n    prompt=\"modern living room interior, natural lighting\"\n)\n```\n\n**Tips:**\n- Clear, well-defined sketches work best\n- Use prompt to guide style and details\n- Great for architectural concepts, product designs\n\n### Restore Old Photos\n\nRepair damaged, noisy, or blurry photos:\n\n```python\nresult = client.restore_image(\"https://example.com/old-photo.jpg\")\n```\n\n**Fixes:**\n- Scratches and tears\n- Noise and grain\n- Blur and degradation\n- Fading and discoloration\n\n### Colorize\n\nAdd color to black & white photos or convert to B&W:\n\n```python\n# Colorize B&W photo\nresult = client.colorize(\n    image_url=\"https://example.com/bw-photo.jpg\",\n    style=\"color_contemporary\"  # Modern color palette\n)\n\n# Convert to B&W\nresult = client.colorize(\n    image_url=\"https://example.com/color-photo.jpg\",\n    style=\"bw\"\n)\n```\n\n**Styles:** `color_contemporary`, `bw`\n\n---\n\n## Product Photography\n\n### Lifestyle Shot by Text\n\nPlace a product in a scene using text description:\n\n```python\n# First, remove background from product\nproduct = client.remove_background(\"https://example.com/product.jpg\")\nproduct_url = product['result']['image_url']\n\n# Then place in lifestyle scene\nresult = client.lifestyle_shot(\n    image_url=product_url,\n    prompt=\"modern kitchen countertop, morning sunlight, minimalist style\",\n    placement_type=\"automatic\"\n)\n```\n\n**Example prompts:**\n- \"wooden desk in home office, natural lighting\"\n- \"marble bathroom vanity, luxury spa atmosphere\"\n- \"outdoor picnic setting, summer day\"\n- \"gym environment, energetic atmosphere\"\n\n### Shot by Reference Image\n\nPlace a product using a reference background:\n\n```python\nresult = client.shot_by_image(\n    image_url=product_url,\n    background_url=\"https://example.com/background.jpg\",\n    placement_type=\"automatic\"\n)\n```\n\n---\n\n## Best Practices\n\n### Prompt Engineering\n\n**Be specific about style:**\n```\nGood: \"professional product photo, white studio background, soft shadows\"\nBad:  \"product photo\"\n```\n\n**Include technical details:**\n- Lighting: \"soft natural light\", \"dramatic studio lighting\", \"golden hour\"\n- Composition: \"centered\", \"rule of thirds\", \"negative space on left\"\n- Style: \"minimalist\", \"luxurious\", \"rustic\", \"modern\"\n\n**Quality keywords:**\n- \"high quality\", \"professional\", \"commercial grade\"\n- \"sharp focus\", \"detailed\", \"4K\"\n- \"award-winning photography\" (for realistic photos)\n\n### Workflow Examples\n\n#### Website Hero Image\n```python\n# Generate hero banner\nhero = client.generate(\n    prompt=\"Modern tech startup office, diverse team collaborating, bright natural light, clean aesthetic\",\n    aspect_ratio=\"16:9\",\n    negative_prompt=\"cluttered, dark, low quality\"\n)\n```\n\n#### E-commerce Product\n```python\n# 1. Generate product photo\nproduct = client.generate(\n    prompt=\"Professional product photo of wireless headphones, white studio background\",\n    aspect_ratio=\"1:1\"\n)\n\n# 2. Remove background for flexibility\ntransparent = client.remove_background(product['result']['image_url'])\n\n# 3. Create lifestyle shot\nlifestyle = client.lifestyle_shot(\n    image_url=transparent['result']['image_url'],\n    prompt=\"modern desk setup, morning coffee, work from home aesthetic\"\n)\n```\n\n#### Social Media Content\n```python\n# Instagram post (1:1)\npost = client.generate(\n    prompt=\"Flat lay coffee and notebook, cozy morning vibes\",\n    aspect_ratio=\"1:1\"\n)\n\n# Story/Reel (9:16)\nstory = client.generate(\n    prompt=\"Vertical product showcase, floating smartphone, gradient background\",\n    aspect_ratio=\"9:16\"\n)\n```\n\n#### Image Transformation Pipeline\n```python\n# Start with any image\noriginal_url = \"https://example.com/photo.jpg\"\n\n# 1. Enhance quality\nenhanced = client.enhance_image(base64_encoded_image)\n\n# 2. Expand to banner format\nexpanded = client.expand_image(\n    enhanced['result']['image_url'],\n    aspect_ratio=\"16:9\"\n)\n\n# 3. Upscale for print\nfinal = client.increase_resolution(\n    expanded['result']['image_url'],\n    scale=2\n)\n```\n\n### Handling Async Responses\n\nAll Bria endpoints return async responses. The Python client handles polling automatically when `wait=True` (default).\n\nFor manual handling:\n```python\nresult = client.generate(\"...\", wait=False)\nstatus_url = result['status_url']\n\n# Poll manually\nimport requests, time\nwhile True:\n    status = requests.get(status_url, headers={\"api_token\": API_KEY}).json()\n    if status['status'] == 'COMPLETED':\n        image_url = status['result']['image_url']\n        break\n    elif status['status'] == 'FAILED':\n        raise Exception(status.get('error'))\n    time.sleep(2)\n```\n\n### Error Handling\n\nCommon errors and solutions:\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| 401 | Invalid API key | Check BRIA_API_KEY |\n| 422 | Invalid parameters | Check required fields and formats |\n| 422 | Content moderation | Modify prompt to avoid prohibited content |\n| 460 | Failed to download | Use base64 instead of URL |\n| 429 | Rate limited | Add delays between requests |\n\n---\n\n## Quick Reference\n\n### Generation\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Generate image | `generate()` | prompt, aspect_ratio |\n| Refine generation | `refine()` | structured_prompt, instruction |\n| Image variation | `inspire()` | image_url, prompt |\n\n### Edit by Text (No Mask)\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Edit by instruction | `edit_image()` | image_url, instruction |\n| Add object | `add_object()` | image_url, instruction |\n| Replace object | `replace_object()` | image_url, instruction |\n| Erase object by name | `erase_object()` | image_url, object_name |\n\n### Edit with Mask\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Generative fill | `gen_fill()` | image, mask, prompt |\n| Erase region | `erase()` | image_url, mask_url |\n\n### Background Operations\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Remove background | `remove_background()` | image_url |\n| Replace background | `replace_background()` | image_url, prompt |\n| Blur background | `blur_background()` | image_url |\n| Erase foreground | `erase_foreground()` | image_url |\n| Crop foreground | `crop_foreground()` | image_url |\n\n### Image Transformation\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Expand/outpaint | `expand_image()` | image_url, aspect_ratio |\n| Enhance quality | `enhance_image()` | image_url |\n| Upscale resolution | `increase_resolution()` | image_url, scale |\n| Blend images | `blend_images()` | image_url, overlay_url, instruction |\n| Change season | `reseason()` | image_url, season |\n| Change style | `restyle()` | image_url, style |\n| Change lighting | `relight()` | image_url, light_type |\n\n### Text & Restoration\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Replace text | `replace_text()` | image_url, new_text |\n| Sketch to image | `sketch_to_image()` | image_url, prompt |\n| Restore photo | `restore_image()` | image_url |\n| Colorize | `colorize()` | image_url, style |\n\n### Product Photography\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Lifestyle shot | `lifestyle_shot()` | image_url, prompt |\n| Shot by reference | `shot_by_image()` | image_url, background_url |\n\n### Utilities\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Get JSON instruction | `generate_structured_instruction()` | image_url, instruction |\n\n---\n\n## Support\n\n- **API Documentation**: https://docs.bria.ai/\n- **API Reference**: See `api-endpoints.md`\n- **Python Client**: See `code-examples/bria_client.py`\n\nFile v0.0.1:LICENSE.txt\n\nMIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\nNote: This skill integrates with Bria.ai's API. Usage of the Bria.ai API is\nsubject to Bria.ai's Terms of Service and API usage policies. The Bria.ai\nAPI and associated models are commercial products - please refer to\nhttps://bria.ai for licensing and pricing information.\n\nArchive v0.1.0: 8 files, 29821 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (9849b), references/code-examples/bria_client.py (21547b), references/code-examples/bria_client.sh (19668b), references/code-examples/bria_client.ts (20620b), references/guide.md (16535b), SKILL.md (21357b), _meta.json (130b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: bria-ai\ndescription: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images.\n---\n\n# Bria Visual Asset Generator\n\nGenerate production-ready visual assets for websites, presentations, documents, and applications using Bria's commercially-safe AI models.\n\n## When to Use This Skill\n\n- **Website/App Development**: Hero images, product photos, backgrounds, illustrations\n- **Presentations**: Slides visuals, diagrams, icons, cover images\n- **Documents**: Report graphics, infographics, headers, decorative elements\n- **Marketing**: Social media assets, banners, promotional images\n- **E-commerce**: Product photography, lifestyle shots, catalog images\n- **Batch Generation**: Multiple images with different prompts concurrently\n- **Pipeline Workflows**: Chained operations (generate → edit → remove background → lifestyle shot)\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Create new images | FIBO Generate | Hero images, product shots, illustrations |\n| Edit by text | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Transparent backgrounds | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Background operations | Replace/Blur/Erase | Change, blur, or remove backgrounds |\n| Expand images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale images | Super Resolution | Increase resolution 2x or 4x |\n| Enhance quality | Enhancement | Improve lighting, colors, details |\n| Transform style | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Blend/composite | Image Blending | Apply textures, logos, merge images |\n| Text replacement | Rewrite | Change text in images |\n| Restore photos | Restoration | Fix old/damaged photos |\n| Colorize | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Product photography | Lifestyle Shot | Place products in scenes |\n\n## Quick Reference\n\n### Generate an Image (FIBO)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\"\n  }'\n```\n\n**Aspect ratios**: `1:1` (square), `16:9` (hero/banner), `4:3` (presentation), `9:16` (mobile/story), `3:4` (portrait)\n\n> **Advanced**: For precise, deterministic control over generation, use **[VGL structured prompts](../vgl/SKILL.md)** instead of natural language. VGL defines every visual attribute (objects, lighting, composition) as explicit JSON.\n\n### Remove Background (RMBG-2.0)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image\": \"https://...\"}'\n```\n\nReturns PNG with transparency.\n\n### Edit Image (FIBO-Edit) - No Mask Required\n\nEdit any image with natural language instructions:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"images\": [\"https://...\"],\n    \"instruction\": \"change the mug to red\"\n  }'\n```\n\n**Python example:**\n```python\nfrom bria_client import BriaClient\nclient = BriaClient()\nresult = client.edit_image(image_url, \"change the mug to red\")\nprint(result['result']['image_url'])\n```\n\n### Edit Image Region with Mask (FIBO-Edit)\n\nFor precise control over which region to edit:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/gen_fill\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"https://...\",\n    \"mask\": \"https://...\",\n    \"prompt\": \"what to generate in masked area\"\n  }'\n```\n\n### Expand Image (Outpainting)\n\nExtend image boundaries to new aspect ratio:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/expand\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"base64-or-url\",\n    \"aspect_ratio\": \"16:9\",\n    \"prompt\": \"coffee shop background, wooden table\"\n  }'\n```\n\n### Upscale Image\n\nIncrease image resolution 2x or 4x:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/increase_resolution\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image\": \"https://...\", \"scale\": 2}'\n```\n\n### Product Lifestyle Shot\n\nPlace a product in a lifestyle scene:\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/lifestyle_shot_by_text\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"https://product-with-transparent-bg.png\",\n    \"prompt\": \"modern kitchen countertop, natural morning light\"\n  }'\n```\n\n---\n\n## Asset Generation Workflows\n\n### Website Hero Images\n\nGenerate wide banner images for landing pages:\n\n```json\n{\n  \"prompt\": \"Modern tech startup workspace with developers collaborating, bright natural lighting, clean minimal aesthetic\",\n  \"aspect_ratio\": \"16:9\",\n  \"negative_prompt\": \"cluttered, dark, low quality\"\n}\n```\n\n**Tips for hero images:**\n- Use `16:9` for full-width banners\n- Describe lighting and mood explicitly\n- Include \"professional\", \"high quality\", \"commercial\" for polished results\n- Specify \"clean background\" or \"minimal\" for text overlay space\n\n### Product Photography\n\nGenerate e-commerce style product shots:\n\n```json\n{\n  \"prompt\": \"Professional product photo of [item] on white studio background, soft shadows, commercial photography lighting\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\n**Then remove background** for transparent PNG to composite anywhere:\n\n```json\n{\"image\": \"generated_image_url\"}\n```\n\n### Presentation Visuals\n\nGenerate slides-ready images:\n\n```json\n{\n  \"prompt\": \"Abstract visualization of data analytics, blue and purple gradient, modern corporate style, clean composition with space for text\",\n  \"aspect_ratio\": \"16:9\"\n}\n```\n\n**Common presentation themes:**\n- \"Abstract technology background\" - tech slides\n- \"Business team collaboration\" - culture slides\n- \"Growth chart visualization\" - metrics slides\n- \"Minimalist geometric patterns\" - section dividers\n\n### Document Graphics\n\nGenerate report or article images:\n\n```json\n{\n  \"prompt\": \"Isometric illustration of cloud computing infrastructure, flat design, vibrant colors, white background\",\n  \"aspect_ratio\": \"4:3\"\n}\n```\n\n### Icons and Illustrations\n\nFor icons, generate then remove background:\n\n```json\n{\n  \"prompt\": \"3D icon of a shield with checkmark, glossy material, soft gradient background, app icon style\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\nThen use RMBG-2.0 to get transparent PNG.\n\n### Social Media Assets\n\n**Instagram post (1:1):**\n```json\n{\n  \"prompt\": \"Lifestyle photo of coffee and laptop on wooden desk, morning light, cozy atmosphere\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\n**Story/Reel (9:16):**\n```json\n{\n  \"prompt\": \"Vertical product showcase of smartphone, floating in gradient background, tech aesthetic\",\n  \"aspect_ratio\": \"9:16\"\n}\n```\n\n---\n\n## Prompt Engineering Tips\n\n### Be Specific About Style\n- \"professional product photography\" vs \"casual snapshot\"\n- \"flat design illustration\" vs \"3D rendered\"\n- \"corporate modern\" vs \"playful colorful\"\n\n### Specify Technical Details\n- Lighting: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- Background: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- Composition: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n\n### Quality Keywords\nAdd these for polished results:\n- \"high quality\", \"professional\", \"commercial grade\"\n- \"4K\", \"detailed\", \"sharp focus\"\n- \"award-winning photography\" (for photos)\n\n### Negative Prompts\nExclude unwanted elements:\n- \"blurry, low quality, pixelated\"\n- \"text, watermark, logo\"\n- \"cluttered, busy, messy\"\n\n---\n\n## Async Response Handling\n\nAll endpoints return async responses:\n\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\nPoll the status_url until `status: \"COMPLETED\"`, then get `result.image_url`.\n\n```python\nimport requests, time\n\ndef get_result(status_url, api_key):\n    while True:\n        r = requests.get(status_url, headers={\"api_token\": api_key})\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n```\n\n---\n\n## Batch & Parallel Image Generation\n\n### Generating Multiple Images Concurrently\n\nFor generating many images efficiently, launch requests in parallel and poll concurrently:\n\n```python\nimport asyncio\nimport aiohttp\n\nasync def generate_image(session, api_key, prompt, aspect_ratio=\"1:1\"):\n    \"\"\"Launch a single generation request.\"\"\"\n    async with session.post(\n        \"https://engine.prod.bria-api.com/v2/image/generate\",\n        headers={\"api_token\": api_key, \"Content-Type\": \"application/json\"},\n        json={\"prompt\": prompt, \"aspect_ratio\": aspect_ratio}\n    ) as resp:\n        return await resp.json()\n\nasync def poll_status(session, api_key, status_url, timeout=120):\n    \"\"\"Poll until complete or failed.\"\"\"\n    for _ in range(timeout // 2):\n        async with session.get(status_url, headers={\"api_token\": api_key}) as resp:\n            data = await resp.json()\n            if data[\"status\"] == \"COMPLETED\":\n                return data[\"result\"][\"image_url\"]\n            if data[\"status\"] == \"FAILED\":\n                raise Exception(data.get(\"error\", \"Generation failed\"))\n        await asyncio.sleep(2)\n    raise TimeoutError(f\"Timeout polling {status_url}\")\n\nasync def generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=5):\n    \"\"\"Generate multiple images with different prompts concurrently.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)  # Rate limiting\n\n    async def generate_one(prompt):\n        async with semaphore:\n            async with aiohttp.ClientSession() as session:\n                # Launch request\n                result = await generate_image(session, api_key, prompt, aspect_ratio)\n                # Poll for completion\n                return await poll_status(session, api_key, result[\"status_url\"])\n\n    # Run all concurrently\n    results = await asyncio.gather(*[generate_one(p) for p in prompts], return_exceptions=True)\n    return results\n\n# Usage\nprompts = [\n    \"Professional photo of running shoes on white background\",\n    \"Professional photo of leather handbag on white background\",\n    \"Professional photo of smartwatch on white background\",\n    \"Professional photo of sunglasses on white background\",\n]\nimage_urls = asyncio.run(generate_batch(\"YOUR_API_KEY\", prompts, max_concurrent=3))\n```\n\n**Key points:**\n- Use `asyncio.Semaphore` to limit concurrent requests (recommended: 3-5)\n- `return_exceptions=True` prevents one failure from canceling all requests\n- Each result is either a URL string or an Exception object\n\n### TypeScript/Node.js Parallel Generation\n\n```typescript\ntype AspectRatio = \"1:1\" | \"4:3\" | \"16:9\" | \"3:4\" | \"9:16\";\n\ninterface BriaResponse {\n  request_id: string;\n  status_url: string;\n}\n\ninterface BriaStatusResponse {\n  status: \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\";\n  result?: { image_url: string };\n  error?: string;\n}\n\ninterface GenerateBatchResult {\n  prompt: string;\n  imageUrl: string | null;\n  error: string | null;\n}\n\nasync function generateBatch(\n  apiKey: string,\n  prompts: string[],\n  aspectRatio: AspectRatio = \"1:1\",\n  maxConcurrent = 5\n): Promise<GenerateBatchResult[]> {\n  const semaphore = { count: 0, max: maxConcurrent };\n\n  async function withLimit<T>(fn: () => Promise<T>): Promise<T> {\n    while (semaphore.count >= semaphore.max) {\n      await new Promise(r => setTimeout(r, 100));\n    }\n    semaphore.count++;\n    try {\n      return await fn();\n    } finally {\n      semaphore.count--;\n    }\n  }\n\n  async function generateOne(prompt: string): Promise<string> {\n    return withLimit(async () => {\n      // Launch request\n      const res = await fetch(\"https://engine.prod.bria-api.com/v2/image/generate\", {\n        method: \"POST\",\n        headers: { \"api_token\": apiKey, \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ prompt, aspect_ratio: aspectRatio })\n      });\n      const { status_url } = (await res.json()) as BriaResponse;\n\n      // Poll for result\n      for (let i = 0; i < 60; i++) {\n        const statusRes = await fetch(status_url, { headers: { \"api_token\": apiKey } });\n        const data = (await statusRes.json()) as BriaStatusResponse;\n        if (data.status === \"COMPLETED\") return data.result!.image_url;\n        if (data.status === \"FAILED\") throw new Error(data.error || \"Generation failed\");\n        await new Promise(r => setTimeout(r, 2000));\n      }\n      throw new Error(\"Timeout waiting for generation\");\n    });\n  }\n\n  const results = await Promise.allSettled(prompts.map(generateOne));\n\n  return results.map((result, i) => ({\n    prompt: prompts[i],\n    imageUrl: result.status === \"fulfilled\" ? result.value : null,\n    error: result.status === \"rejected\" ? result.reason.message : null\n  }));\n}\n\n// Usage\nconst results = await generateBatch(process.env.BRIA_API_KEY!, [\n  \"Modern office workspace with natural lighting\",\n  \"Abstract tech background with blue gradient\",\n  \"Professional headshot studio setup\"\n], \"16:9\", 3);\n\nresults.forEach(r => {\n  if (r.imageUrl) console.log(`✓ ${r.prompt}: ${r.imageUrl}`);\n  else console.log(`✗ ${r.prompt}: ${r.error}`);\n});\n```\n```\n\n---\n\n## Pipeline Workflows\n\nChain multiple operations on images (generate → edit → remove background).\n\n### Complete Pipeline Example\n\n```python\nasync def product_pipeline(api_key, product_descriptions, scene_prompt):\n    \"\"\"\n    Pipeline: Generate product → Remove background → Place in lifestyle scene\n    \"\"\"\n    async with aiohttp.ClientSession() as session:\n        results = []\n\n        for desc in product_descriptions:\n            # Step 1: Generate product image\n            gen_result = await generate_image(session, api_key,\n                f\"Professional product photo of {desc} on white background, studio lighting\",\n                aspect_ratio=\"1:1\")\n            product_url = await poll_status(session, api_key, gen_result[\"status_url\"])\n\n            # Step 2: Remove background\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\"},\n                json={\"image\": product_url}\n            ) as resp:\n                rmbg_result = await resp.json()\n            transparent_url = await poll_status(session, api_key, rmbg_result[\"status_url\"])\n\n            # Step 3: Place in lifestyle scene\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/lifestyle_shot_by_text\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\"},\n                json={\"image\": transparent_url, \"prompt\": scene_prompt}\n            ) as resp:\n                lifestyle_result = await resp.json()\n            final_url = await poll_status(session, api_key, lifestyle_result[\"status_url\"])\n\n            results.append({\n                \"product\": desc,\n                \"original\": product_url,\n                \"transparent\": transparent_url,\n                \"lifestyle\": final_url\n            })\n\n        return results\n\n# Usage\nproducts = [\"coffee mug\", \"water bottle\", \"notebook\"]\nscene = \"modern minimalist desk, natural morning light, plants in background\"\nresults = asyncio.run(product_pipeline(\"YOUR_API_KEY\", products, scene))\n```\n\n### Parallel Pipeline (Advanced)\n\nProcess multiple products through the pipeline concurrently:\n\n```python\nasync def parallel_pipeline(api_key, products, scene_prompt, max_concurrent=3):\n    \"\"\"Run full pipeline for multiple products in parallel.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)\n\n    async def process_one(product):\n        async with semaphore:\n            return await single_product_pipeline(api_key, product, scene_prompt)\n\n    return await asyncio.gather(*[process_one(p) for p in products], return_exceptions=True)\n```\n\n### Common Pipeline Patterns\n\n| Pipeline | Steps | Use Case |\n|----------|-------|----------|\n| Product → Transparent | generate → remove_background | E-commerce cutouts |\n| Product → Lifestyle | generate → remove_background → lifestyle_shot | Marketing photos |\n| Edit → Upscale | edit → increase_resolution | High-res edited images |\n| Generate → Restyle | generate → restyle | Artistic variations |\n| Generate → Variations | generate (num_results=4) | A/B testing options |\n\n---\n\n## Integration Examples\n\n### React/Next.js Component\n\n```jsx\n// Generate and display a hero image\nconst [imageUrl, setImageUrl] = useState(null);\n\nasync function generateHero(prompt) {\n  const res = await fetch('/api/bria/generate', {\n    method: 'POST',\n    body: JSON.stringify({ prompt, aspect_ratio: '16:9' })\n  });\n  const { image_url } = await res.json();\n  setImageUrl(image_url);\n}\n```\n\n### Python Script for Batch Generation\n\n```python\nimport asyncio\n\n# See \"Batch & Parallel Image Generation\" section for generate_batch function\n\nasync def main():\n    api_key = \"YOUR_API_KEY\"\n    products = [\"running shoes\", \"leather bag\", \"smart watch\"]\n    prompts = [f\"Professional product photo of {p} on white background\" for p in products]\n\n    results = await generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=3)\n\n    for product, result in zip(products, results):\n        if isinstance(result, Exception):\n            print(f\"{product}: FAILED - {result}\")\n        else:\n            print(f\"{product}: {result}\")\n\nasyncio.run(main())\n```\n\n---\n\n## API Reference\n\nSee `references/api-endpoints.md` for complete endpoint documentation.\n\n### Key Endpoints\n\n**Generation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/generate` | Generate images from text (FIBO) |\n\n**Edit by Text (No Mask)**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit` | Edit image with natural language instruction |\n| `POST /v2/image/edit/add_object_by_text` | Add objects to image |\n| `POST /v2/image/edit/replace_object_by_text` | Replace objects in image |\n| `POST /v2/image/edit/erase_by_text` | Remove objects by name |\n\n**Edit with Mask**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/gen_fill` | Inpaint/generate in masked region |\n| `POST /v2/image/edit/erase` | Erase masked region |\n\n**Background Operations**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/remove_background` | Remove background (RMBG-2.0) |\n| `POST /v2/image/edit/replace_background` | Replace with AI-generated background |\n| `POST /v2/image/edit/blur_background` | Apply blur to background |\n| `POST /v2/image/edit/erase_foreground` | Remove foreground, fill background |\n| `POST /v2/image/edit/crop_foreground` | Crop tightly around subject |\n\n**Image Transformation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/expand` | Outpaint to new aspect ratio |\n| `POST /v2/image/edit/enhance` | Enhance quality and details |\n| `POST /v2/image/edit/increase_resolution` | Upscale 2x or 4x |\n| `POST /v2/image/edit/blend` | Blend/merge images or textures |\n| `POST /v2/image/edit/reseason` | Change season/weather |\n| `POST /v2/image/edit/restyle` | Transform artistic style |\n| `POST /v2/image/edit/relight` | Modify lighting |\n\n**Text & Restoration**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/replace_text` | Replace text in image |\n| `POST /v2/image/edit/sketch_to_image` | Convert sketch to photo |\n| `POST /v2/image/edit/restore` | Restore old/damaged photos |\n| `POST /v2/image/edit/colorize` | Colorize B&W or convert to B&W |\n\n**Product Photography**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/lifestyle_shot_by_text` | Place product in scene by text |\n| `POST /v2/image/edit/shot_by_image` | Place product on reference background |\n\n**Utilities**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/structured_instruction/generate` | Generate JSON instruction (no image) |\n| `GET /v2/status/{id}` | Check async request status |\n\n### Authentication\n\nAll requests need `api_token` header:\n```\napi_token: YOUR_BRIA_API_KEY\n```\n\n---\n\n## Related Skills\n\n- **[vgl](../vgl/SKILL.md)** - Write structured VGL (Visual Generation Language) JSON prompts for precise, deterministic control over FIBO image generation. Use VGL for reproducible outputs with explicit visual attributes.\n- **[image-utils](../image-utils/SKILL.md)** - Classic image manipulation (resize, crop, composite, watermarks) for post-processing Bria outputs\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai-api\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1770313887313\n}\n\nFile v0.1.0:references/api-endpoints.md\n\n# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include `api_token` header in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\n```\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required | Image description |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement) |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to generate in masked area |\n| `mask_type` | string | \"manual\" | \"manual\" or \"automatic\" |\n| `negative_prompt` | string | - | What to avoid |\n| `num_results` | int | 1 | Number of variations |\n\n**Mask Requirements:**\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n- Same aspect ratio as source image\n\n### POST /v2/image/edit/erase\n\nRemove objects defined by mask.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\"\n}\n```\n\n### POST /v2/image/edit/erase_foreground\n\nRemove primary subject and fill with background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/replace_background\n\nReplace background with AI-generated content.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"prompt\": \"new background description\"\n}\n```\n\n### POST /v2/image/edit/blur_background\n\nApply blur effect to image background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/expand\n\nExpand/outpaint an image to extend its boundaries.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-string-or-url\",\n  \"aspect_ratio\": \"16:9\",\n  \"prompt\": \"optional description for new content\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 string |\n| `aspect_ratio` | string | required | Target ratio: \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `prompt` | string | - | Optional - describe content to generate |\n\n### POST /v2/image/edit/enhance\n\nEnhance image quality (lighting, colors, details).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/increase_resolution\n\nUpscale image resolution.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"scale\": 2\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `scale` | int | 2 | Upscale factor (2 or 4) |\n\n### POST /v2/image/edit/lifestyle_shot_by_text\n\nPlace a product in a lifestyle scene using text description.\n\n**Request:**\n```json\n{\n  \"image\": \"https://product-image-url\",\n  \"prompt\": \"modern kitchen countertop, natural lighting\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n### POST /v2/image/edit/shot_by_image\n\nPlace a product on a reference background image.\n\n**Request:**\n```json\n{\n  \"image\": \"https://product-image-url\",\n  \"background\": \"https://background-image-url\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n---\n\n## Text-Based Object Editing\n\n### POST /v2/image/edit/add_object_by_text\n\nAdd a new object to an image using natural language.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Place a red vase with flowers on the table\"\n}\n```\n\n### POST /v2/image/edit/replace_object_by_text\n\nReplace an existing object with a new one.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Replace the red apple with a green pear\"\n}\n```\n\n### POST /v2/image/edit/erase_by_text\n\nRemove a specific object by name.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"object_name\": \"table\"\n}\n```\n\n---\n\n## Image Transformation\n\n### POST /v2/image/edit/blend\n\nBlend/merge images or apply textures.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"overlay\": \"texture-or-art-url\",\n  \"instruction\": \"Place the art on the shirt, keep the art exactly the same\"\n}\n```\n\n### POST /v2/image/edit/reseason\n\nChange the season or weather of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"season\": \"winter\"\n}\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### POST /v2/image/edit/restyle\n\nTransform the artistic style of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"oil_painting\"\n}\n```\n\n**Style IDs:** `render_3d`, `cubism`, `oil_painting`, `anime`, `cartoon`, `coloring_book`, `retro_ad`, `pop_art_halftone`, `vector_art`, `story_board`, `art_nouveau`, `cross_etching`, `wood_cut`\n\n### POST /v2/image/edit/relight\n\nModify the lighting setup of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"light_type\": \"spotlight on subject, keep background settings\"\n}\n```\n\n---\n\n## Text in Images\n\n### POST /v2/image/edit/replace_text\n\nReplace existing text in an image with new text.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"new_text\": \"FIBO Edit!\"\n}\n```\n\n---\n\n## Image Restoration & Conversion\n\n### POST /v2/image/edit/sketch_to_image\n\nConvert a sketch or line drawing to a photorealistic image.\n\n**Request:**\n```json\n{\n  \"image\": \"sketch-base64-or-url\",\n  \"prompt\": \"optional description\"\n}\n```\n\n### POST /v2/image/edit/restore\n\nRestore old/damaged photos by removing noise, scratches, and blur.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n### POST /v2/image/edit/colorize\n\nAdd color to B&W photos or convert to B&W.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"color_contemporary\"\n}\n```\n\n**Styles:** `color_contemporary`, `bw`\n\n### POST /v2/image/edit/crop_foreground\n\nRemove background and crop tightly around the foreground.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n---\n\n## Structured Instructions\n\n### POST /v2/structured_instruction/generate\n\nGenerate a structured JSON instruction from natural language (no image generated).\n\n**Request:**\n```json\n{\n  \"images\": [\"base64-or-url\"],\n  \"instruction\": \"change to golden hour lighting\",\n  \"mask\": \"optional-mask-url\"\n}\n```\n\n**Returns:** `structured_instruction` JSON that can be passed to `/v2/image/edit`\n\n---\n\n## Status Polling\n\n### GET /v2/status/{request_id}\n\nCheck async request status.\n\n**Response:**\n```json\n{\n  \"status\": \"IN_PROGRESS | COMPLETED | FAILED\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  },\n  \"request_id\": \"uuid\"\n}\n```\n\n**Status Values:**\n- `IN_PROGRESS` - Still processing\n- `COMPLETED` - Success, result available\n- `FAILED` - Error occurred\n\n**Polling Pattern:**\n```python\nimport requests, time\n\ndef poll(status_url, api_key, timeout=120):\n    for _ in range(timeout // 2):\n        r = requests.get(status_url, headers={\"api_token\": api_key})\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n    raise TimeoutError()\n```\n\n---\n\n## Error Handling\n\n### HTTP Status Codes\n\n| Code | Description |\n|------|-------------|\n| 200 | Success |\n| 400 | Bad request |\n| 401 | Unauthorized - invalid API key |\n| 415 | Unsupported media type |\n| 422 | Validation failed / Content moderation blocked |\n| 429 | Rate limited |\n| 500 | Server error |\n\n### Supported Image Formats\n\n- **Input:** JPEG, JPG, PNG, WEBP (RGB, RGBA, CMYK)\n- **Output:** PNG (with transparency where applicable)\n\nFile v0.1.0:references/guide.md\n\n# Bria AI Visual Asset Generator - Complete Guide\n\nThis guide covers all capabilities of the Bria AI skill for generating and editing visual assets.\n\n## Table of Contents\n\n1. [Setup](#setup)\n2. [Image Generation (FIBO)](#image-generation-fibo)\n3. [Image Editing](#image-editing)\n4. [Text-Based Object Editing](#text-based-object-editing)\n5. [Background Operations](#background-operations)\n6. [Image Enhancement](#image-enhancement)\n7. [Image Transformation](#image-transformation)\n8. [Text & Restoration](#text--restoration)\n9. [Product Photography](#product-photography)\n10. [Best Practices](#best-practices)\n\n---\n\n## Setup\n\n### Authentication\n\nAll Bria API requests require an API key. Set it as an environment variable:\n\n```bash\nexport BRIA_API_KEY=\"your-api-key-here\"\n```\n\n### Using the Python Client\n\n```python\nfrom bria_client import BriaClient\n\nclient = BriaClient()  # Uses BRIA_API_KEY env var\n# or\nclient = BriaClient(api_key=\"your-key\")\n```\n\n### Input Formats\n\nBria accepts images in two formats:\n- **URL**: Publicly accessible image URL\n- **Base64**: Raw base64 encoded string (for most edit endpoints) or data URL `data:image/png;base64,...` (for `/v2/image/edit`)\n\n---\n\n## Image Generation (FIBO)\n\nFIBO is Bria's text-to-image model that generates high-quality, commercially-safe images.\n\n### Basic Generation\n\n```python\nresult = client.generate(\n    prompt=\"Modern coffee shop interior, warm lighting, minimalist design\",\n    aspect_ratio=\"16:9\"\n)\nprint(result['result']['image_url'])\n```\n\n### Aspect Ratios\n\n| Ratio | Use Case |\n|-------|----------|\n| `1:1` | Social media posts, product photos, icons |\n| `4:3` | Presentations, documents |\n| `16:9` | Hero banners, website headers, videos |\n| `3:4` | Portrait photos, mobile content |\n| `9:16` | Stories, reels, mobile-first content |\n\n### Using Negative Prompts\n\nExclude unwanted elements:\n\n```python\nresult = client.generate(\n    prompt=\"Professional headshot, studio lighting\",\n    aspect_ratio=\"1:1\",\n    negative_prompt=\"blurry, low quality, distorted, watermark\"\n)\n```\n\n### Refining Generated Images\n\nUse the `structured_prompt` from a previous generation to make modifications:\n\n```python\n# First generation\nresult = client.generate(\"Red sports car in desert\")\nstructured_prompt = result['result']['structured_prompt']\n\n# Refine it\nrefined = client.refine(\n    structured_prompt=structured_prompt,\n    instruction=\"change to blue color, add mountains in background\",\n    aspect_ratio=\"16:9\"\n)\n```\n\n### Inspire Mode (Image-to-Image)\n\nGenerate variations based on a reference image:\n\n```python\nresult = client.inspire(\n    image_url=\"https://example.com/reference.jpg\",\n    prompt=\"same style but with autumn colors\",\n    aspect_ratio=\"1:1\"\n)\n```\n\n---\n\n## Image Editing\n\n### Edit by Instruction (No Mask Required)\n\nThe simplest way to edit - just describe what you want to change:\n\n```python\nresult = client.edit_image(\n    image_url=\"data:image/png;base64,{base64_string}\",\n    instruction=\"change the mug color to red\"\n)\n```\n\n**Example instructions:**\n- \"make the sky more dramatic\"\n- \"change the car to silver\"\n- \"add sunglasses to the person\"\n- \"make it look like winter\"\n\n### Edit with Mask (Precise Control)\n\nFor precise edits, use a mask to define the region:\n\n```python\nresult = client.gen_fill(\n    image_url=\"https://example.com/image.jpg\",\n    mask_url=\"https://example.com/mask.png\",  # White = edit, Black = keep\n    prompt=\"red leather armchair\",\n    mask_type=\"manual\"\n)\n```\n\n**Mask requirements:**\n- Same dimensions as source image\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n\n### Erase Objects\n\nRemove unwanted objects from an image:\n\n```python\nresult = client.erase(\n    image_url=\"https://example.com/image.jpg\",\n    mask_url=\"https://example.com/mask.png\"  # White = area to erase\n)\n```\n\n---\n\n## Text-Based Object Editing\n\nEdit images by describing what to add, replace, or remove - no mask required.\n\n### Add Object\n\nAdd new objects to an image using natural language:\n\n```python\nresult = client.add_object(\n    image_url=\"https://example.com/room.jpg\",\n    instruction=\"Place a red vase with flowers on the table\"\n)\n```\n\n**Example instructions:**\n- \"Add a laptop on the desk\"\n- \"Place a cat sleeping on the couch\"\n- \"Add a plant in the corner\"\n\n### Replace Object\n\nReplace existing objects with new ones:\n\n```python\nresult = client.replace_object(\n    image_url=\"https://example.com/fruit.jpg\",\n    instruction=\"Replace the red apple with a green pear\"\n)\n```\n\n**Example instructions:**\n- \"Replace the wooden chair with a modern office chair\"\n- \"Change the coffee mug to a wine glass\"\n- \"Replace the landscape painting with abstract art\"\n\n### Erase Object by Name\n\nRemove specific objects without needing a mask:\n\n```python\nresult = client.erase_object(\n    image_url=\"https://example.com/scene.jpg\",\n    object_name=\"table\"\n)\n```\n\n**Common removals:**\n- \"person\", \"car\", \"text\", \"watermark\"\n- \"shadow\", \"reflection\"\n- Specific objects: \"lamp\", \"chair\", \"tree\"\n\n---\n\n## Background Operations\n\n### Remove Background (RMBG-2.0)\n\nExtract subjects with transparent backgrounds:\n\n```python\nresult = client.remove_background(\"https://example.com/product.jpg\")\n# Returns PNG with transparency\n```\n\n**Use cases:**\n- Product cutouts for e-commerce\n- Logo extraction\n- Creating stickers/overlays\n- Compositing subjects into new scenes\n\n### Replace Background\n\nReplace the background with AI-generated content:\n\n```python\nresult = client.replace_background(\n    image_url=\"https://example.com/portrait.jpg\",\n    prompt=\"professional office environment, soft lighting\"\n)\n```\n\n### Blur Background\n\nApply a blur effect to the background (portrait mode):\n\n```python\nresult = client.blur_background(\"https://example.com/photo.jpg\")\n```\n\n### Erase Foreground\n\nRemove the main subject and fill with background:\n\n```python\nresult = client.erase_foreground(\"https://example.com/image.jpg\")\n```\n\n---\n\n## Image Enhancement\n\n### Expand Image (Outpainting)\n\nExtend image boundaries to a new aspect ratio:\n\n```python\n# Convert a 1:1 image to 16:9 banner\nresult = client.expand_image(\n    image_url=base64_string,\n    aspect_ratio=\"16:9\",\n    prompt=\"continue the scene with similar style\"\n)\n```\n\n**Common workflows:**\n- Square product photo → 16:9 hero banner\n- Portrait → landscape for presentations\n- Add space for text overlays\n\n### Enhance Quality\n\nImprove lighting, colors, and details:\n\n```python\nresult = client.enhance_image(base64_string)\n```\n\n### Increase Resolution (Upscale)\n\nUpscale images 2x or 4x:\n\n```python\nresult = client.increase_resolution(\n    image_url=base64_string,\n    scale=2  # or 4\n)\n```\n\n---\n\n## Image Transformation\n\nTransform the style, lighting, season, or composition of images.\n\n### Blend Images\n\nMerge images or apply textures/overlays:\n\n```python\nresult = client.blend_images(\n    image_url=\"https://example.com/tshirt.jpg\",\n    overlay_url=\"https://example.com/design.png\",\n    instruction=\"Place the art on the shirt, keep the art exactly the same\"\n)\n```\n\n**Use cases:**\n- Apply logos or designs to products\n- Add textures to surfaces\n- Composite multiple images together\n\n### Change Season (Reseason)\n\nTransform the season or weather atmosphere:\n\n```python\nresult = client.reseason(\n    image_url=\"https://example.com/landscape.jpg\",\n    season=\"winter\"  # spring, summer, autumn, winter\n)\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### Change Style (Restyle)\n\nTransform the artistic style of an image:\n\n```python\nresult = client.restyle(\n    image_url=\"https://example.com/photo.jpg\",\n    style=\"oil_painting\"\n)\n```\n\n**Available styles:**\n- `render_3d` - 3D rendered look\n- `oil_painting` - Classic oil painting\n- `anime` - Anime/manga style\n- `cartoon` - Cartoon illustration\n- `coloring_book` - Line art for coloring\n- `retro_ad` - Vintage advertisement\n- `pop_art_halftone` - Pop art with halftone dots\n- `vector_art` - Flat vector graphics\n- `story_board` - Storyboard sketch\n- `art_nouveau` - Art nouveau style\n- `cross_etching` - Cross-hatched etching\n- `wood_cut` - Woodcut print\n- `cubism` - Cubist art style\n\n### Change Lighting (Relight)\n\nModify the lighting setup of an image:\n\n```python\nresult = client.relight(\n    image_url=\"https://example.com/portrait.jpg\",\n    light_type=\"spotlight on subject, keep background settings\"\n)\n```\n\n**Lighting descriptions:**\n- \"golden hour warm lighting\"\n- \"dramatic spotlight from above\"\n- \"soft diffused studio lighting\"\n- \"neon blue and pink rim lighting\"\n\n---\n\n## Text & Restoration\n\nWork with text in images and restore old photos.\n\n### Replace Text\n\nReplace existing text in images with new text:\n\n```python\nresult = client.replace_text(\n    image_url=\"https://example.com/sign.jpg\",\n    new_text=\"SALE 50% OFF\"\n)\n```\n\n**Use cases:**\n- Update signage in photos\n- Localize marketing materials\n- Change product labels\n\n### Sketch to Image\n\nConvert sketches or line drawings to photorealistic images:\n\n```python\nresult = client.sketch_to_image(\n    image_url=\"https://example.com/sketch.png\",\n    prompt=\"modern living room interior, natural lighting\"\n)\n```\n\n**Tips:**\n- Clear, well-defined sketches work best\n- Use prompt to guide style and details\n- Great for architectural concepts, product designs\n\n### Restore Old Photos\n\nRepair damaged, noisy, or blurry photos:\n\n```python\nresult = client.restore_image(\"https://example.com/old-photo.jpg\")\n```\n\n**Fixes:**\n- Scratches and tears\n- Noise and grain\n- Blur and degradation\n- Fading and discoloration\n\n### Colorize\n\nAdd color to black & white photos or convert to B&W:\n\n```python\n# Colorize B&W photo\nresult = client.colorize(\n    image_url=\"https://example.com/bw-photo.jpg\",\n    style=\"color_contemporary\"  # Modern color palette\n)\n\n# Convert to B&W\nresult = client.colorize(\n    image_url=\"https://example.com/color-photo.jpg\",\n    style=\"bw\"\n)\n```\n\n**Styles:** `color_contemporary`, `bw`\n\n---\n\n## Product Photography\n\n### Lifestyle Shot by Text\n\nPlace a product in a scene using text description:\n\n```python\n# First, remove background from product\nproduct = client.remove_background(\"https://example.com/product.jpg\")\nproduct_url = product['result']['image_url']\n\n# Then place in lifestyle scene\nresult = client.lifestyle_shot(\n    image_url=product_url,\n    prompt=\"modern kitchen countertop, morning sunlight, minimalist style\",\n    placement_type=\"automatic\"\n)\n```\n\n**Example prompts:**\n- \"wooden desk in home office, natural lighting\"\n- \"marble bathroom vanity, luxury spa atmosphere\"\n- \"outdoor picnic setting, summer day\"\n- \"gym environment, energetic atmosphere\"\n\n### Shot by Reference Image\n\nPlace a product using a reference background:\n\n```python\nresult = client.shot_by_image(\n    image_url=product_url,\n    background_url=\"https://example.com/background.jpg\",\n    placement_type=\"automatic\"\n)\n```\n\n---\n\n## Best Practices\n\n### Prompt Engineering\n\n**Be specific about style:**\n```\nGood: \"professional product photo, white studio background, soft shadows\"\nBad:  \"product photo\"\n```\n\n**Include technical details:**\n- Lighting: \"soft natural light\", \"dramatic studio lighting\", \"golden hour\"\n- Composition: \"centered\", \"rule of thirds\", \"negative space on left\"\n- Style: \"minimalist\", \"luxurious\", \"rustic\", \"modern\"\n\n**Quality keywords:**\n- \"high quality\", \"professional\", \"commercial grade\"\n- \"sharp focus\", \"detailed\", \"4K\"\n- \"award-winning photography\" (for realistic photos)\n\n### Workflow Examples\n\n#### Website Hero Image\n```python\n# Generate hero banner\nhero = client.generate(\n    prompt=\"Modern tech startup office, diverse team collaborating, bright natural light, clean aesthetic\",\n    aspect_ratio=\"16:9\",\n    negative_prompt=\"cluttered, dark, low quality\"\n)\n```\n\n#### E-commerce Product\n```python\n# 1. Generate product photo\nproduct = client.generate(\n    prompt=\"Professional product photo of wireless headphones, white studio background\",\n    aspect_ratio=\"1:1\"\n)\n\n# 2. Remove background for flexibility\ntransparent = client.remove_background(product['result']['image_url'])\n\n# 3. Create lifestyle shot\nlifestyle = client.lifestyle_shot(\n    image_url=transparent['result']['image_url'],\n    prompt=\"modern desk setup, morning coffee, work from home aesthetic\"\n)\n```\n\n#### Social Media Content\n```python\n# Instagram post (1:1)\npost = client.generate(\n    prompt=\"Flat lay coffee and notebook, cozy morning vibes\",\n    aspect_ratio=\"1:1\"\n)\n\n# Story/Reel (9:16)\nstory = client.generate(\n    prompt=\"Vertical product showcase, floating smartphone, gradient background\",\n    aspect_ratio=\"9:16\"\n)\n```\n\n#### Image Transformation Pipeline\n```python\n# Start with any image\noriginal_url = \"https://example.com/photo.jpg\"\n\n# 1. Enhance quality\nenhanced = client.enhance_image(base64_encoded_image)\n\n# 2. Expand to banner format\nexpanded = client.expand_image(\n    enhanced['result']['image_url'],\n    aspect_ratio=\"16:9\"\n)\n\n# 3. Upscale for print\nfinal = client.increase_resolution(\n    expanded['result']['image_url'],\n    scale=2\n)\n```\n\n### Handling Async Responses\n\nAll Bria endpoints return async responses. The Python client handles polling automatically when `wait=True` (default).\n\nFor manual handling:\n```python\nresult = client.generate(\"...\", wait=False)\nstatus_url = result['status_url']\n\n# Poll manually\nimport requests, time\nwhile True:\n    status = requests.get(status_url, headers={\"api_token\": API_KEY}).json()\n    if status['status'] == 'COMPLETED':\n        image_url = status['result']['image_url']\n        break\n    elif status['status'] == 'FAILED':\n        raise Exception(status.get('error'))\n    time.sleep(2)\n```\n\n### Error Handling\n\nCommon errors and solutions:\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| 401 | Invalid API key | Check BRIA_API_KEY |\n| 422 | Invalid parameters | Check required fields and formats |\n| 422 | Content moderation | Modify prompt to avoid prohibited content |\n| 460 | Failed to download | Use base64 instead of URL |\n| 429 | Rate limited | Add delays between requests |\n\n---\n\n## Quick Reference\n\n### Generation\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Generate image | `generate()` | prompt, aspect_ratio |\n| Refine generation | `refine()` | structured_prompt, instruction |\n| Image variation | `inspire()` | image_url, prompt |\n\n### Edit by Text (No Mask)\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Edit by instruction | `edit_image()` | image_url, instruction |\n| Add object | `add_object()` | image_url, instruction |\n| Replace object | `replace_object()` | image_url, instruction |\n| Erase object by name | `erase_object()` | image_url, object_name |\n\n### Edit with Mask\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Generative fill | `gen_fill()` | image, mask, prompt |\n| Erase region | `erase()` | image_url, mask_url |\n\n### Background Operations\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Remove background | `remove_background()` | image_url |\n| Replace background | `replace_background()` | image_url, prompt |\n| Blur background | `blur_background()` | image_url |\n| Erase foreground | `erase_foreground()` | image_url |\n| Crop foreground | `crop_foreground()` | image_url |\n\n### Image Transformation\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Expand/outpaint | `expand_image()` | image_url, aspect_ratio |\n| Enhance quality | `enhance_image()` | image_url |\n| Upscale resolution | `increase_resolution()` | image_url, scale |\n| Blend images | `blend_images()` | image_url, overlay_url, instruction |\n| Change season | `reseason()` | image_url, season |\n| Change style | `restyle()` | image_url, style |\n| Change lighting | `relight()` | image_url, light_type |\n\n### Text & Restoration\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Replace text | `replace_text()` | image_url, new_text |\n| Sketch to image | `sketch_to_image()` | image_url, prompt |\n| Restore photo | `restore_image()` | image_url |\n| Colorize | `colorize()` | image_url, style |\n\n### Product Photography\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Lifestyle shot | `lifestyle_shot()` | image_url, prompt |\n| Shot by reference | `shot_by_image()` | image_url, background_url |\n\n### Utilities\n| Task | Method | Key Parameters |\n|------|--------|----------------|\n| Get JSON instruction | `generate_structured_instruction()` | image_url, instruction |\n\n---\n\n## Support\n\n- **API Documentation**: https://docs.bria.ai/\n- **API Reference**: See `api-endpoints.md`\n- **Python Client**: See `code-examples/bria_client.py`\n\nFile v0.1.0:LICENSE.txt\n\nMIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\nNote: This skill integrates with Bria.ai's API. Usage of the Bria.ai API is\nsubject to Bria.ai's Terms of Service and API usage policies. The Bria.ai\nAPI and associated models are commercial products - please refer to\nhttps://bria.ai for licensing and pricing information.","readmeExcerpt":"Skill: Bria Ai API Client Owner: galbria Summary: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images. Tags: latest:0.0.1 Versio","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"curl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{"},{"language":"bash","snippet":"curl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\"\n  }'"},{"language":"bash","snippet":"curl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image\": \"https://...\"}'"},{"language":"bash","snippet":"curl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image\": \"https://...\"}'"},{"language":"bash","snippet":"curl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{"},{"language":"bash","snippet":"curl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"images\": [\"https://...\"],\n    \"instruction\": \"change the mug to red\"\n  }'"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: bria-ai\ndescription: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images.\n---\n\n# Bria Visual Asset Generator\n\nGenerate production-ready visual assets for websites, presentations, documents, and applications using Bria's commercially-safe AI models.\n\n## When to Use This Skill\n\n- **Website/App Development**: Hero images, product photos, backgrounds, illustrations\n- **Presentations**: Slides visuals, diagrams, icons, cover images\n- **Documents**: Report graphics, infographics, headers, decorative elements\n- **Marketing**: Social media assets, banners, promotional images\n- **E-commerce**: Product photography, lifestyle shots, catalog images\n- **Batch Generation**: Multiple images with different prompts concurrently\n- **Pipeline Workflows**: Chained operations (generate → edit → remove background → lifestyle shot)\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Create new images | FIBO Generate | Hero images, product shots, illustrations |\n| Edit by text | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Transparent backgrounds | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Background operations | Replace/Blur/Erase | Change, blur, or remove backgrounds |\n| Expand images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale images | Super Resolution | Increase resolution 2x or 4x |\n| Enhance quality | Enhancement | Improve lighting, colors, details |\n| Transform style | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Blend/composite | Image Blending | Apply textures, logos, merge images |\n| Text replacement | Rewrite | Change text in images |\n| Restore photos | Restoration | Fix old/damaged photos |\n| Colorize | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Product photography | Lifestyle Shot | Place products in scenes |\n\n## Quick Reference\n\n### Generate an Image (FIBO)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\"\n  }'\n```\n\n**Aspect ratios**: `1:1` (square), `16:9` (hero/banner), `4:3` (presentation), `9:16` (mobile/story), `3:4` (portrait)\n\n> **Advanced**: For precise, deterministic control"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai-api\",\n  \"version\": \"0.0.1\",\n  \"publishedAt\": 1770313965752\n}"},{"path":"references/api-endpoints.md","content":"# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include `api_token` header in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\n```\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required | Image description |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement) |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to g"},{"path":"references/guide.md","content":"# Bria AI Visual Asset Generator - Complete Guide\n\nThis guide covers all capabilities of the Bria AI skill for generating and editing visual assets.\n\n## Table of Contents\n\n1. [Setup](#setup)\n2. [Image Generation (FIBO)](#image-generation-fibo)\n3. [Image Editing](#image-editing)\n4. [Text-Based Object Editing](#text-based-object-editing)\n5. [Background Operations](#background-operations)\n6. [Image Enhancement](#image-enhancement)\n7. [Image Transformation](#image-transformation)\n8. [Text & Restoration](#text--restoration)\n9. [Product Photography](#product-photography)\n10. [Best Practices](#best-practices)\n\n---\n\n## Setup\n\n### Authentication\n\nAll Bria API requests require an API key. Set it as an environment variable:\n\n```bash\nexport BRIA_API_KEY=\"your-api-key-here\"\n```\n\n### Using the Python Client\n\n```python\nfrom bria_client import BriaClient\n\nclient = BriaClient()  # Uses BRIA_API_KEY env var\n# or\nclient = BriaClient(api_key=\"your-key\")\n```\n\n### Input Formats\n\nBria accepts images in two formats:\n- **URL**: Publicly accessible image URL\n- **Base64**: Raw base64 encoded string (for most edit endpoints) or data URL `data:image/png;base64,...` (for `/v2/image/edit`)\n\n---\n\n## Image Generation (FIBO)\n\nFIBO is Bria's text-to-image model that generates high-quality, commercially-safe images.\n\n### Basic Generation\n\n```python\nresult = client.generate(\n    prompt=\"Modern coffee shop interior, warm lighting, minimalist design\",\n    aspect_ratio=\"16:9\"\n)\nprint(result['result']['image_url'])\n```\n\n### Aspect Ratios\n\n| Ratio | Use Case |\n|-------|----------|\n| `1:1` | Social media posts, product photos, icons |\n| `4:3` | Presentations, documents |\n| `16:9` | Hero banners, website headers, videos |\n| `3:4` | Portrait photos, mobile content |\n| `9:16` | Stories, reels, mobile-first content |\n\n### Using Negative Prompts\n\nExclude unwanted elements:\n\n```python\nresult = client.generate(\n    prompt=\"Professional headshot, studio lighting\",\n    aspect_ratio=\"1:1\",\n    negative_prompt=\"blurry, low quality, distorted, watermark\"\n)\n```\n\n### Refining Generated Images\n\nUse the `structured_prompt` from a previous generation to make modifications:\n\n```python\n# First generation\nresult = client.generate(\"Red sports car in desert\")\nstructured_prompt = result['result']['structured_prompt']\n\n# Refine it\nrefined = client.refine(\n    structured_prompt=structured_prompt,\n    instruction=\"change to blue color, add mountains in background\",\n    aspect_ratio=\"16:9\"\n)\n```\n\n### Inspire Mode (Image-to-Image)\n\nGenerate variations based on a reference image:\n\n```python\nresult = client.inspire(\n    image_url=\"https://example.com/reference.jpg\",\n    prompt=\"same style but with autumn colors\",\n    aspect_ratio=\"1:1\"\n)\n```\n\n---\n\n## Image Editing\n\n### Edit by Instruction (No Mask Required)\n\nThe simplest way to edit - just describe what you want to change:\n\n```python\nresult = client.edit_image(\n    image_url=\"data:image/png;base64,{base64_string}\",\n    instruction=\"change the mug color to red\"\n)\n```\n\n"},{"path":"LICENSE.txt","content":"MIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\nNote: This skill integrates with Bria.ai's API. Usage of the Bria.ai API is\nsubject to Bria.ai's Terms of Service and API usage policies. The Bria.ai\nAPI and associated models are commercial products - please refer to\nhttps://bria.ai for licensing and pricing information."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images. Skill: Bria Ai API Client Owner: galbria Summary: Use when generating visual assets with Bria.ai - product photos, hero images, icons, backgrounds. Includes batch generation (multiple images concurrently), pipeline workflows (generate → edit → remove background), and parallel API patterns. Use for websites, presentations, e-commerce catalogs, or any task needing multiple AI-generated images. Tags: latest:0.0.1 Versio","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1506,"uniquenessScore":46,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T11:12:55.215Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}