Bria Replace Background API image preview

Bria Replace Background API

Image·bria·by Bria

Replace an image background with a prompt-guided or reference-image scene while preserving the original subject.

Runtime (p50)
1m
Estimated price
$0.04
Call the API
prediction.sh
sh
curl -X POST \
  -H "Authorization: Bearer $EACHLABS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "model": "bria-replace-background",
    "version": "0.0.1",
    "input": {
        "mode": "fast",
        "image": "https://cdn-us.eachlabs.ai/defaults/d4b1010250b04826a20f8122327c743f.png",
        "prompt": "Keep the headphones exactly as they are, fully preserved and unchanged. Replace only the background: place the headphones on a clean minimalist desk with a soft neutral tone, a subtle blurred modern interior behind, gentle natural light and a soft shadow beneath. Calm, premium, tidy aesthetic. Photorealistic, sharp product, shallow depth of field. No text.",
        "refine_prompt": true,
        "enhance_reference_images": true,
        "prompt_content_moderation": true,
        "visual_output_content_moderation": true
    },
    "webhook_url": ""
}' \
  https://api.eachlabs.ai/v1/prediction/
Documentation8 sections
  • Overview

    Bria | Replace Background Overview

    Bria | Replace Background is an image-to-image background replacement model that removes an existing background and composites the original foreground subject onto a new, AI-generated or reference-image scene while preserving fine details and edges. Built on Bria’s RMBG 2.0 professional background segmentation technology, it is trained exclusively on licensed commercial data, making it well suited for production workflows that require clear IP and data provenance. The model focuses on accurate foreground extraction and soft alpha mattes, enabling high-quality, prompt-guided background swaps for product photography, marketing visuals, and creative design pipelines.

  • Capabilities

    Capabilities

    • Removes complex image backgrounds while preserving fine foreground edges such as hair, fur, and soft textures through a grayscale alpha matte.
    • Generates a transparent output (typically PNG) that can be directly composited onto any new background.
    • Supports common web and design image formats including JPEG, PNG, WebP, GIF, and AVIF for input.
    • Maintains input dimensions up to roughly 1024×1024 in common RMBG-based deployments, keeping aspect ratio intact.
    • Provides a non-binary alpha mask, enabling custom foreground thresholds and advanced blending in professional pipelines.
    • Operates with low latency, fitting real-time or near real-time editing workflows and interactive UI experiences.
    • Backed by licensed commercial training data, facilitating use in commercial products and brand-sensitive applications.
  • Use cases

    Use Cases for Bria | Replace Background

    For ecommerce creators, Bria | Replace Background can isolate products and drop them onto clean, brand-aligned canvases, using the transparent PNG output to swap in seasonal or campaign-specific scenes. A typical prompt for the generative background might be: "Minimalist white tabletop with soft studio lighting for cosmetics product."

    Marketing teams can standardize catalog imagery by removing busy backgrounds and replacing them with consistent branded environments, leveraging the non-binary alpha matte for smooth blending into templates. Example prompt: "Brand-colored gradient backdrop with subtle vignette for social media ad."

    Designers can rapidly prototype composites by extracting models or objects and combining them with stylized backgrounds produced by other Bria image-to-image tools, ensuring resolution and aspect ratio remain stable. Prompt example: "Urban street scene at dusk with neon signs and reflective pavement."

    Developers building creative apps on each::labs can expose the Bria | Replace Background API as a utility endpoint for one-click background removal and replacement inside custom editors or automation pipelines.

  • Tips & tricks

    Tips and Tricks

    To get the most out of Bria | Replace Background, start with high-resolution images where the main subject is clearly separated from the background, and avoid heavy motion blur or extreme low light. When using the Bria | Replace Background API inside a broader Bria image-to-image pipeline, configure your output format to PNG or WEBP to preserve the alpha channel, then composite the subject onto a new scene in your graphics stack. For prompt-guided replacement, pair the transparent output with a generative background model, using short, focused prompts describing lighting, setting, and style.

    Example prompts for the new background layer:

    • "Clean white studio backdrop with soft shadows for ecommerce product shot"

    • "Modern office environment with large windows and natural daylight"

    • "Cinematic sunset beach scene, warm golden light, shallow depth of field"

  • Technical spec

    Technical Specifications

    • Model family: Bria RMBG 2.0 image segmentation, adapted for background removal and replacement.
    • Input formats: JPEG, PNG, WebP, GIF, AVIF via URL or uploaded image, depending on integration.
    • Output formats: Typically PNG with alpha channel transparency; JPG and WEBP also supported in RMBG-based APIs when transparency is not required.
    • Resolution: Up to approximately 1024×1024 while preserving input dimensions in common RMBG pipelines.
    • Alpha matte: Single-channel 8-bit grayscale alpha matte for flexible foreground/background compositing.
    • Latency: Optimized for near real-time image processing; Bria’s related video background APIs report sub-100 ms server inference, indicating similar low-latency design for image tasks.
    • Access: Available via Bria | Replace Background API integrations and compatible image-to-image workflows built on Bria image-to-image models.
  • Things to be aware of

    Things to Be Aware Of

    Bria | Replace Background inherits typical background-removal edge cases: heavily cluttered scenes, subjects overlapping similar-colored backgrounds, and extreme motion blur can reduce mask accuracy. Very low-resolution inputs may produce less precise alpha mattes, making fine hair or thin objects harder to preserve cleanly. When using the Bria | Replace Background API, ensure that you select an output format supporting transparency; choosing JPG will discard alpha channels and limit compositing flexibility. Also account for runtime and bandwidth in high-volume workflows, especially if you are chaining this model with separate generative background steps in an image-to-image pipeline.

  • Key considerations

    Key Considerations

    Bria | Replace Background is best used when you need reliable foreground extraction and a clean, transparent output to composite onto custom scenes or branded backdrops. For optimal results, source images should be reasonably well lit with clear subject-background separation, as this leverages the model’s dichotomous segmentation strengths. The model excels in pipelines where IP compliance matters because Bria’s training data is commercially licensed. When integrating the Bria | Replace Background API, plan for PNG or WEBP output if you need transparency, and ensure your downstream tools can handle alpha channels and mask-based compositing.

  • Limitations

    Limitations

    Bria | Replace Background is designed for single-image background replacement and does not, by itself, generate new backgrounds; it relies on downstream compositing or separate generative models for the replacement scene. Resolution in common RMBG deployments is typically capped around 1024×1024, so ultra-high-resolution editing may require additional upscaling or alternative tooling. The model may struggle with extremely complex transparency (e.g., fine glass reflections) and highly occluded subjects, where foreground and background are difficult to separate. Users should also note that prompt-based control applies to the background generation step, not directly to the Bria | Replace Background mask output.

Related models

4 models