Vector Graphics Generation (Beta)

Generate Vector Graphics - Base (Beta)

Description

The /text-to-vector/base route offers the ability to generate high-quality, editable vector graphic assets from textual prompts at scale. This endpoint allows for generating quality vector graphics such as icons, logos, and other illustrations.

Examples:

prompt: A sticker of a cute kitten

prompt: A beautiful butterfly

On the left, a generated vector illustration. On the right, the same illustration after being re-colored in a vector editor

Guidance Methods

This API supports various guidance methods to provide greater control over text-to-image generation. These methods condition the model on additional inputs derived from user-provided images, allowing for more precise and controlled image generation.

Importantly, users can provide any image they want as input. Our pipeline automatically transforms the input image according to the selected guidance method. For example, if you choose the depth guidance method, our pipeline will extract a depth map from your provided image and use it during the generation inference.

Currently, we support the following guidance methods:

  1. controlnet_canny: Extracts edge information from the input image to guide generation based on structural outlines.
  2. controlnet_depth: Derives depth information from the input image to influence spatial arrangement in generated images.
  3. controlnet_recoloring: Uses grayscale version of the input image to guide recoloring while preserving geometry.
  4. controlnet_color_grid: Extracts a 16x16 color grid from the input image to guide the overall color scheme of generated images.

Using Guidance Methods You can specify up to four guidance methods in a single request. Each method requires an accompanying image and a scale parameter to determine its impact on the generation inference. Note: When using multiple guidance methods, all input images must have the same aspect ratio, which will determine the aspect ratio of the generated results. To use a guidance method, include the following parameters in your request:

  • guidance_method_X: Specify the guidance method (where X is 1, 2, 3, or 4). If the paramter guidance_method_2 is used, so does guidance_method_1 has to be used, and so on. If you would like to use only one method, use the paratmer guidance_method_1
  • guidance_method_X_scale: Set the impact of the guidance (0.0 to 1.0)
  • guidance_method_X_image_file: Provide the base64-encoded input image

By leveraging these guidance methods, you can achieve more precise control over the generated images, tailoring them to your specific needs and creative vision.

Request
path Parameters
model_version
required
string

The model version you would like to use in the request.

Value: "2.3"
header Parameters
api_token
required
string
Request Body schema: application/json
required
prompt
string

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

num_results
integer [ 1 .. 4 ]
Default: 4

How many images you would like to generate. When using any Guidance Method, please use the value 1.

aspect_ratio
string
Default: "1:1"

The aspect ratio of the image.

Enum: "1:1" "2:3" "3:2" "3:4" "4:3" "4:5" "5:4" "9:16" "16:9"
sync
boolean
Default: false

Determines the response mode. When true, responses are synchronous. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. Use polling for the URLs to retrieve images once ready.

seed
integer

You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt, model type and model version. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

negative_prompt
string

Specify here elements that you didn't ask in the prompt, but are being generated, and you would like to exclude. This parameter is optional. Bria currently supports prompts in English only.

steps_num
integer [ 20 .. 50 ]
Default: 30

The number of iterations the model goes through to refine the generated image. This parameter is optional.

text_guidance_scale
number <float> [ 1 .. 10 ]
Default: 5

Determines how closely the generated image should adhere to the input text description. This parameter is optional.

guidance_method_1
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_1_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_1_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

guidance_method_2
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_2_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_2_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_2. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

guidance_method_3
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_3_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_3_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_3. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

guidance_method_4
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_4_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_4_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_4. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

Responses
200

Successful operation.

209

Successful operation, a model version that is no longer available was requested. The request was redirected to the latest model version.

400

Bad request.

405

Method not allowed.

500

Internal server error.

post/text-to-vector/base/{model_version}
Request samples

Generate Vector Graphics - Fast (Beta)

Description

The /text-to-vector/fast route is optimized for speed, enabling rapid vector graphics creation without compromising quality. This endpoint allows for generating high-quality vector graphics such as icons, logos, and other illustrations.

Examples:

prompt: An icon of a bird with a blue head and yellow beak against a solid background

Guidance Methods

This API supports various guidance methods to provide greater control over text-to-image generation. These methods condition the model on additional inputs derived from user-provided images, allowing for more precise and controlled image generation.

Importantly, users can provide any image they want as input. Our pipeline automatically transforms the input image according to the selected guidance method. For example, if you choose the depth guidance method, our pipeline will extract a depth map from your provided image and use it during the generation inference.

Currently, we support the following guidance methods:

  1. controlnet_canny: Extracts edge information from the input image to guide generation based on structural outlines.
  2. controlnet_depth: Derives depth information from the input image to influence spatial arrangement in generated images.
  3. controlnet_recoloring: Uses grayscale version of the input image to guide recoloring while preserving geometry.
  4. controlnet_color_grid: Extracts a 16x16 color grid from the input image to guide the overall color scheme of generated images.

Using Guidance Methods

You can specify up to four guidance methods in a single request. Each method requires an accompanying image and a scale parameter to determine its impact on the generation inference. Note: When using multiple guidance methods, all input images must have the same aspect ratio, which will determine the aspect ratio of the generated results. To use a guidance method, include the following parameters in your request:

  • guidance_method_X: Specify the guidance method (where X is 1, 2, 3, or 4). If the paramter guidance_method_2 is used, so does guidance_method_1 has to be used, and so on. If you would like to use only one method, use the paratmer guidance_method_1
  • guidance_method_X_scale: Set the impact of the guidance (0.0 to 1.0)
  • guidance_method_X_image_file: Provide the base64-encoded input image

By leveraging these guidance methods, you can achieve more precise control over the generated images, tailoring them to your specific needs and creative vision.

Request
path Parameters
model_version
required
string

The model version you would like to use in the request.

Value: "2.3"
header Parameters
api_token
required
string
Request Body schema: application/json
required
prompt
string

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

num_results
integer [ 1 .. 4 ]
Default: 4

How many images you would like to generate.

aspect_ratio
string
Default: "1:1"

The aspect ratio of the image.

Enum: "1:1" "2:3" "3:2" "3:4" "4:3" "4:5" "5:4" "9:16" "16:9"
sync
boolean
Default: false

Determines the response mode. When true, responses are synchronous. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. Use polling for the URLs to retrieve images once ready.

seed
integer

You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt, model type and model version. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

steps_num
integer [ 4 .. 10 ]
Default: 8

The number of iterations the model goes through to refine the generated image. This parameter is optional.

guidance_method_1
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_1_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_1_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

guidance_method_2
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_2_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_2_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_2. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

guidance_method_3
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_3_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_3_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_3. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

guidance_method_4
string

Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional.

Enum: "controlnet_canny" "controlnet_depth" "controlnet_recoloring" "controlnet_color_grid"
guidance_method_4_scale
number <float> [ 0 .. 1 ]
Default: 1

The impact of the guidance.

guidance_method_4_image_file
string

The image that should be used as guidance, in base64 format, with the method defined in guidance_method_4. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided.

Responses
200

Successful operation.

400

Bad request.

405

Method not allowed.

500

Internal server error.

post/text-to-vector/fast/{model_version}
Request samples