POST
javascript
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); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr *

The prompt you would like to use to generate images. Bria currently supports prompts in English only, excluding special characters.


modestr ( default: base )

Choose output quality with 'base' for normal, 'fast' for speed, 'hd' for high detail.


aspect_ratioenum:str ( default: 1:1 )

Set shape like '16:9' for wide, '1:1' for square formats.

Allowed values:


seedint ( default: 654321 )

Use specific numbers like '654321' to ensure repeatable results.

min : 1,

max : 999999


negative_promptstr ( default: no storms )

Remove unwanted elements e.g., 'no storms' for calm views.


steps_numint ( default: 40 )

Adjust detail with '50' for intricate detail, '20' for faster processing.

min : 20,

max : 50


text_guidance_scalefloat ( default: 7 )

Control prompt adherence with '10' for precise or '1' for flexible outputs.

min : 1,

max : 10


mediumenum:str ( default: photography )

Define style; use 'photography' for realism, 'art' for creativity.

Allowed values:


prompt_enhancementboolean ( default: true )

Enhance creativity. 'True' for variation, 'false' for consistency.


enhance_imageboolean ( default: true )

Improve clarity with 'true' for better textures, 'false' for raw visuals.


prompt_content_moderationboolean ( default: true )

Scan prompts for safety with 'true' on, 'false' off.


content_moderationboolean ( default: 1 )

Moderate images for compliance. 'True' if needed, 'false' otherwise.


ip_signalboolean ( default: 1 )

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 – Multi-Modal Image Model

What is Bria AI Image Generation Toolkit?

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:

  • Text-to-Image API: Transforms natural-language prompts into high-fidelity visuals.
  • Reimagine API: Alters materials, colors, and textures of existing images while preserving outlines and depth.
  • Text-to-Vector API: Generates scalable vector graphics (icons, logos) with crisp clarity at any resolution.
    Built on licensed datasets and patented attribution methods, Bria AI ensures brand consistency, responsible AI usage, and seamless integration into web and mobile workflows.

Key Features

  • Versatile Prompt Parameters
    – Prompt enhancement (true/false) for creative variation
    – Negative prompts to exclude unwanted elements (e.g., “no storms”)
    – Seed control for repeatability (1 – 999,999)
  • Quality & Performance Modes
    base for standard generation
    fast for rapid prototypes
    hd for high-detail, production-grade imagery
  • Aspect Ratio Options
    – Predefined ratios: 1:1, 16:9, 9:16, 4:5, and more
  • Guidance & Steps
    – Text guidance scale (1–10) to balance precision vs. creativity
    – Adjustable steps (20–50) for speed vs. intricacy
  • Built-In Moderation
    – Prompt and content checks to enforce safety and compliance
    – Optional IP signal detection for proprietary art

Best Use Cases

  • E-commerce: Auto-generate product mockups and lifestyle scenes from text
  • Gaming: Create environmental assets, character concepts, and UI icons
  • Branding: Rapid logo iterations with Text-to-Vector API
  • Sketch-to-Art Conversion: Turn line drawings into polished artwork via Reimagine API
  • Marketing & Advertising: Produce banner images tailored to campaign copy

Prompt Tips and Output Quality

  1. Be Specific: “A serene underwater utopia with bioluminescent corals” yields richer details.
  2. Mode Selection: Use hd for final assets; fast for testing ideas.
  3. Aspect Ratio: Match your app layout—16:9 for widescreen, 1:1 for social media.
  4. Negative Prompting: Add “no crowds” or “no text” to refine focus.
  5. Seed & Reproducibility: Lock in a seed (e.g., 654321) to regenerate identical outputs.
  6. Guidance vs. Creativity: Lower text guidance (3–5) for abstract styles; higher (8–10) for strict adherence.

FAQs

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.