Bria Blur Background
Bria AI Image Editing API v2 enables precise and context-aware image manipulation for stunning visual outcomes.
API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/bria-blur-background"
# Request payload
data = {
"image": "https://segmind-resources.s3.amazonaws.com/input/d8806bf3-26b3-4fa7-bf06-818b4eb3494b-7f1198b9-2961-4dc1-ad67-e9c60013b44a.jpeg",
"scale": 5,
"preserve_alpha": True,
"visual_input_content_moderation": False,
"visual_output_content_moderation": False
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Input an image URL for processing. Use clear, high-resolution images for best results.
Set blur intensity from 1 to 5. Use 3 for moderate background blur.
min : 1,
max : 5
Retains transparency if enabled. Useful for logos and overlays.
Enables moderation to filter input. Activate for sensitive operations.
Ensures moderated output. Enable for compliance requirements.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Resources to get you started
Everything you need to know to get the most out of Bria Blur Background
# Bria AI Image Editing API v2 – Effective Usage Guide
Leverage Bria AI’s Image Editing API v2 to streamline object removal, generative fills, background edits, canvas expansions and more. This guide covers best practices, recommended parameter settings, and use-case examples.
## 1. Getting Started
- Provide high-resolution inputs (≥1024×1024px) for cleaner results.
- Supply precise binary masks when removing objects or inpainting.
- Chain enhancement and upscaling steps for optimal detail.
## 2. Core Parameters
| Parameter | Type | Default | Description |
|------------------------------------|----------|---------|--------------------------------------------------------|
| `image` | string | — | URL of the input image (clear, high-res) |
| `scale` | integer | 3 | Blur intensity for background edits (1=min, 5=max) |
| `preserve_alpha` | boolean | true | Retain transparency (logos, overlays) |
| `visual_input_content_moderation` | boolean | false | Filter sensitive input images |
| `visual_output_content_moderation` | boolean | false | Enforce compliance on generated output |
## 3. Parameter Recommendations by Use Case
1. **Object Removal (Eraser)**
- Mask target area accurately.
- `preserve_alpha`: false
- Moderation flags: off
Result: Pixel-perfect fill based on surrounding context.
2. **Generative Fill**
- Provide mask + prompt (e.g., “add wildflowers along shoreline”).
- `preserve_alpha`: false
- Moderation: on if using user-generated prompts.
- `scale`: N/A (fills follow text instructions).
3. **Background Editing & Blur**
- Replace or blur existing background.
- `scale`: 2 (subtle), 3 (balanced), 5 (strong blur).
- `preserve_alpha`: false when cutting out subjects.
4. **Canvas Expansion (Outpainting)**
- Define expanded canvas area with transparent margins.
- Use descriptive prompt for style match.
- `preserve_alpha`: true (if extending overlays).
5. **Enhance & Upscale**
- Step 1: Enhance Image
• Increases sharpness, boosts textures.
- Step 2: Increase Resolution (up to 4×)
• Preserves edges, no synthetic artifacts.
- `preserve_alpha`: true for UI assets.
## 4. Best Practices
- **Iterative Refinement**: Preview intermediate outputs; adjust masks or prompts.
- **High-Quality Masks**: Simplify complex edges with feathered brush strokes.
- **Content Moderation**: Enable `visual_input_content_moderation` and `visual_output_content_moderation` when processing user-generated or sensitive imagery to ensure safety and compliance.
- **Prompt Clarity**: Be specific—“replace sky with a pink sunset with wispy clouds” yields more accurate generative fills.
By tuning these parameters per workflow, Bria AI v2 delivers seamless, context-aware edits across photography, e-commerce, marketing, gaming, and print applications.
Other Popular Models
Discover other models you might be interested in.
storydiffusion
Story Diffusion turns your written narratives into stunning image sequences.

idm-vton
Best-in-class clothing virtual try on in the wild

sdxl1.0-txt2img
The SDXL model is the official upgrade to the v1.5 model. The model is released as open-source software

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
