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
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/bria-text-to-image";
const data = {
"prompt": "A professional headshot of a CEO",
"mode": "base",
"aspect_ratio": "1:1",
"seed": 654321,
"negative_prompt": "no storms",
"steps_num": 40,
"text_guidance_scale": 7,
"medium": "photography",
"prompt_enhancement": true,
"enhance_image": true,
"prompt_content_moderation": true,
"content_moderation": false,
"ip_signal": false
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
The prompt you would like to use to generate images. Bria currently supports prompts in English only, excluding special characters.
Choose output quality with 'base' for normal, 'fast' for speed, 'hd' for high detail.
Set shape like '16:9' for wide, '1:1' for square formats.
Allowed values:
Use specific numbers like '654321' to ensure repeatable results.
min : 1,
max : 999999
Remove unwanted elements e.g., 'no storms' for calm views.
Adjust detail with '50' for intricate detail, '20' for faster processing.
min : 20,
max : 50
Control prompt adherence with '10' for precise or '1' for flexible outputs.
min : 1,
max : 10
Define style; use 'photography' for realism, 'art' for creativity.
Allowed values:
Enhance creativity. 'True' for variation, 'false' for consistency.
Improve clarity with 'true' for better textures, 'false' for raw visuals.
Scan prompts for safety with 'true' on, 'false' off.
Moderate images for compliance. 'True' if needed, 'false' otherwise.
Alert for IP content with 'true'; 'false' to ignore.
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.
Bria AI Image Generation Toolkit is a suite of powerful APIs designed for developers, creators, and product managers who need robust generative and editing capabilities. It includes three core models:
base
for standard generationfast
for rapid prototypeshd
for high-detail, production-grade imageryhd
for final assets; fast
for testing ideas.16:9
for widescreen, 1:1
for social media.Q: How do I integrate Bria AI into my app?
A: Simply call the RESTful endpoints with your API key, supplying JSON parameters like prompt
, mode
, and aspect_ratio
. Our SDKs for Python, JavaScript, and Go streamline authentication and error handling.
Q: Can I edit an existing photo’s color palette?
A: Yes—use the Reimagine API’s image input and specify new medium
(e.g., “art”) or custom color directives. The original depth and structure remain intact.
Q: How do I generate vector icons?
A: Invoke Text-to-Vector with a concise prompt such as “minimalist leaf logo,” set medium
to “art,” and receive an SVG-ready output.
Q: Are outputs repeatable?
A: Include a fixed seed
and identical parameter settings to reproduce the same image every time.
For detailed integration guides and code samples, visit our developer documentation and explore quickstart tutorials.