openapi: 3.0.0
info:
  title: Overview
  version: ''
  description: >
    Bria’s Image Generation API provides builders with a flexible and
    controllable way to generate high-quality visuals from textual prompts or
    reference images.  

    It supports various resolutions, aspect ratios, and generation speeds,
    enabling scalable and efficient production of photos, illustrations, and
    vector graphics for commercial use.


    **Advanced Customization and Access:**  

    As part of Bria’s **Source Code & Weights** product, developers seeking
    deeper customization can access Bria’s source-available GenAI models via
    [Hugging Face](https://huggingface.co/briaai).  

    This allows full control over fine-tuning, pipeline creation, and
    integration into proprietary workflows—empowering AI teams to develop and
    optimize their own generative AI solutions.


    ### **Guidance Methods**  


    Some of the APIs below support various guidance methods to provide greater
    control over generation. These methods enable to guide the generation using
    not only a textual prompt, but also visuals.


    The following APIs support guidance methods:


    - `/text-to-image/base`  

    - `/text-to-image/fast`  

    - `/text-to-vector/base`  

    - `/text-to-vector/fast`  


    **ControlNets:**  

    A set of methods that allow conditioning the model on additional inputs,
    providing detailed control over image generation.  


    - **controlnet_canny**: Uses edge information from the input image to guide
    generation based on structural outlines.  

    - **controlnet_depth**: Derives depth information to influence spatial
    arrangement in the generated image.  

    - **controlnet_recoloring**: Uses a grayscale version of the input image to
    guide recoloring while preserving geometry.  

    - **controlnet_color_grid**: Extracts a 16x16 color grid from the input
    image to guide the color scheme of the generated image.  


    You can specify up to two ControlNet guidance methods in a single request.
    Each method requires an accompanying image and a scale parameter to
    determine its impact on the generation inference. 


    When using multiple ControlNets, all input images must have the same aspect
    ratio, which will determine the aspect ratio of the generated results. 


    To use **ControlNets**, include the following parameters in your request:  


    - `guidance_method_X`: Specify the guidance method (where X is 1, 2). If the
    parameter `guidance_method_2` is used, `guidance_method_1` must also be
    used. If you want to use only one method, use `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.


    <table>
      <tr>
        <th>Guidance Method</th>
        <th>Prompt</th>
        <th>Scale</th>
        <th style="width: 150px;">Input Image</th>
        <th style="width: 150px;">Guidance Image</th>
        <th style="width: 150px;">Output Image</th>
      </tr>
      <tr>
        <td>ControlNet Canny</td>
        <td>An exotic colorful shell on the beach</td>
        <td>1.0</td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/canny_input.jpg"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/canny_map.png"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/canny_output.png"></td>
      </tr>
      <tr>
        <td>ControlNet Depth</td>
        <td>A dog, exploring an alien planet</td>
        <td>0.8</td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/depth_input.jpg"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/depth_map.webp"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/depth_output.png"></td>
      </tr>
      <tr>
        <td>ControlNet Recoloring</td>
        <td>A vibrant photo of a woman</td>
        <td>1.00</td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/recoloring_input.png"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/recoloring_map.webp"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/recoloring_output.png"></td>
      </tr>
      <tr>
        <td>ControlNet Color Grid</td>
        <td>A dynamic fantasy illustration of an erupting volcano</td>
        <td>0.7</td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/colorgrid_input.png"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/colorgrid_map.png"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.amazonaws.com/api_doc/cns/colorgrid_output.png"></td>
      </tr>
    </table>  


    **Image Prompt Adapter:**  


    This method offers two modes:  


    - **regular**: Uses the image’s content, style elements, and color palette
    to guide generation.

    - **style_only**: Uses the image’s high-level style elements and color
    palette to influence the generated output.


    To use **Image Prompt Adapter** as guidance, include the following
    parameters in your request:


    - `image_prompt_mode`: Specify how the input image influences the
    generation.

    - `image_prompt_scale`: Set the impact of the provided image on the
    generated result (0.0 to 1.0).

    - `image_prompt_file`: Provide the base64-encoded image file to be used as
    guidance.


    or

    - `image_prompt_urls`: Provide a list of URLs pointing to publicly
    accessible images to be used as guidance.


    <table>
      <tr>
        <th>Guidance Method</th>
        <th>Prompt</th>
        <th>Mode</th>
        <th>Scale</th>
        <th style="width: 150px;">Guidance Image</th>
        <th style="width: 150px;">Output Image</th>
      </tr>
      <tr>
        <td>Image Prompt Adapter</td>
        <td>A drawing of a lion laid on a table.</td>
        <td>regular</td>
        <td>0.85</td>
        <td style="width: 150px;"><img src="https://images.pexels.com/photos/3246665/pexels-photo-3246665.png"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.us-east-1.amazonaws.com/temp_exp_or/image.png"></td>
      </tr>
      <tr>
        <td>Image Prompt Adapter</td>
        <td>A drawing of a bird.</td>
        <td>style</td>
        <td>1</td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.us-east-1.amazonaws.com/temp_exp_or/photo-1575995872537-3793d29d972c.avif"></td>
        <td style="width: 150px;"><img src="https://bria-datasets.s3.us-east-1.amazonaws.com/temp_exp_or/seed_627499055.png"></td>
      </tr>
    </table>  
externalDocs:
  description: Register and get API Access
  url: https://platform.bria.ai/console/account/api-keys
servers:
  - url: https://engine.prod.bria-api.com/v1
paths:
  /text-to-image/base/{model_version}:
    post:
      summary: Generate Image - Base model
      tags:
        - Endpoints
      description: >-

        **Description**


        The /text-to-image/base Route empowers users to create stunning images
        directly from textual prompts. This pipeline allows for generating
        high-quality, photorealistic and artistic, images with a resolution of
        up to 1024x1024 pixels, supporting a variety of aspect ratios natively
        to accommodate diverse creative needs.


        **Examples:**


        **prompt**: A professional headshot of a CEO



        <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/2.3/image+(50).png"
        width="200" height="200"/> <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/2.3/image+(51).png"
        width="200" height="200"/> <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/2.3/image+(53).png"
        width="200" height="200"/> <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/2.3/image+(52).png"
        width="200" height="200"/>        

        This API endpoint supports content moderation via an optional parameter
        that can prevent generation if input images contain inappropriate
        content, and filters out unsafe generated images - the first blocked
        input image will fail the entire request.
      operationId: text-to-image-base
      parameters:
        - in: path
          name: model_version
          schema:
            type: string
            enum:
              - '2.3'
          required: true
          description: The model version you would like to use in the request.
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    The prompt you would like to use to generate images. Bria
                    currently supports prompts in English only, excluding
                    special characters.
                num_results:
                  type: integer
                  description: >-
                    How many images you would like to generate. When using any
                    Guidance Method, please use the value 1.
                  minimum: 1
                  default: 4
                  maximum: 4
                aspect_ratio:
                  type: string
                  description: >-
                    The aspect ratio of the image. When a ControlNet is being
                    used, the aspect ratio is defined by the guidance image and
                    this parameter is ignored.
                  default: '1:1'
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                sync:
                  type: boolean
                  description: >-
                    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.
                  default: false
                seed:
                  type: integer
                  description: >-
                    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:
                  type: string
                  description: >-
                    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:
                  type: integer
                  description: >-
                    The number of iterations the model goes through to refine
                    the generated image. This parameter is optional.
                  minimum: 20
                  default: 30
                  maximum: 50
                text_guidance_scale:
                  type: number
                  format: float
                  description: >-
                    Determines how closely the generated image should adhere to
                    the input text description. This parameter is optional.
                  minimum: 1
                  maximum: 10
                  default: 5
                medium:
                  type: string
                  enum:
                    - photography
                    - art
                  description: >-
                    Which medium should be included in your generated images.
                    This parameter is optional.
                prompt_enhancement:
                  type: boolean
                  description: >-
                    When set to true, enhances the provided prompt by generating
                    additional, more descriptive variations, resulting in more
                    diverse and creative output images. Note that turning this
                    flag on may result in a few additional seconds to the
                    inference time. Built with Meta Llama 3.
                  default: false
                content_moderation:
                  type: boolean
                  default: false
                  description: >
                    When enabled, applies content moderation to both input
                    visuals and generated outputs.


                    For input images:

                    - Processing stops at the first image that fails moderation

                    - Returns a 422 error with details about which parameter
                    failed


                    For synchronous requests (sync=true):

                    - If all generated images fail moderation, returns a 422
                    error

                    - If some images pass and others fail, returns a 200
                    response with successful generations and "blocked" objects
                    for failed ones


                    For asynchronous requests (sync=false):

                    - Failed images are replaced with zero-byte files at their
                    placeholder URLs

                    - Successful images are stored at their original placeholder
                    URLs
                guidance_method_1:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_1_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_1_image_file:
                  type: string
                  description: >-
                    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:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_2_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_2_image_file:
                  type: string
                  description: >-
                    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.
                image_prompt_mode:
                  type: string
                  enum:
                    - regular
                    - style_only
                  default: regular
                  description: >
                    - `regular`: Uses the image’s content, style elements, and
                    color palette to guide generation.

                    - `style_only`: Uses the image’s high-level style elements
                    and color palette to influence the generated output.
                image_prompt_file:
                  type: string
                  description: >
                    The image file to be used as guidance, in base64 format.
                    Accepted formats are jpeg, jpg, png, webp.

                    Maximum file size 12MB. This image can be of any aspect
                    ratio, even when it's not alligned with the one defined in
                    the parameter 'aspect_ratio' or by visuals provided to the
                    ControlNets.
                image_prompt_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: >
                    A list of URLs of images that should be used as guidance.
                    The images can be of different aspect ratios. Accepted
                    formats are jpeg, jpg, png, webp.

                    The URLs should point to accessible, publicly available
                    images.
                image_prompt_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: >
                    The impact of the provided image on the generated results. A
                    value between 0.0 (no impact) and 1.0 (full impact).
            example:
              prompt: a book
              num_results: 2
              sync: true
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
              examples:
                success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_222222.png
                        seed: 222222
                        uuid: some_uuid_222222
                partial_success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - blocked: true
                        error_code: '422'
                        description: >-
                          The request could not be completed because the
                          generated visual did not pass content moderation.
        '209':
          description: >-
            Successful operation, a model version that is no longer available
            was requested. The request was redirected to the latest model
            version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
        '400':
          description: Bad request.
        '403':
          description: Forbidden. Insufficient permissions to access the image URL..
        '405':
          description: Method not allowed.
        '415':
          description: >-
            Unsupported Media Type. Invalid file type. Supported file types are
            jpeg, jpg, png, webp.
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: string
              examples:
                input_violation:
                  value: >-
                    The request could not be completed because the visual in the
                    '{parameter_name}' parameter did not pass content
                    moderation.
                all_outputs_blocked:
                  value: >-
                    The request could not be completed because all generated
                    visuals did not pass content moderation.
                invalid_url:
                  value: >-
                    Unprocessable Entity. The URL does not point to a valid
                    image or is inaccessible.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
  /text-to-image/fast/{model_version}:
    post:
      summary: Generate Image - fast model
      tags:
        - Endpoints
      description: >-


        **Description**


        The /text-to-image/fast Route is optimized for speed, enabling rapid
        image creation without compromising quality. This model allows for
        generating high-quality, photorealistic and artistic, images with a
        resolution of up to 1024x1024 pixels, supporting a variety of aspect
        ratios natively to accommodate diverse creative needs.  Ideal for
        applications requiring quick turnaround without sacrificing image
        fidelity.


        **An example:**


        **prompt**: A portrait of a Beautiful and playful ethereal singer, art
        deco, fantasy, intricate art deco golden designs, elegant, highly
        detailed, sharp focus, blurry background, teal and orange shades


        **BRIA FAST model 2.3:**


        <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/fast/image+(42).png"
        width="200" height="200"/> <img
        src="https://images.bria.ai/images/b0788963e23ce367.png" width="200"
        height="200"/> <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/fast/image+(43).png"
        width="200" height="200"/> <img
        src="https://images.bria.ai/images/cdee459b344d1a31.png" width="200"
        height="200"/>    

        This API endpoint supports content moderation via an optional parameter
        that can prevent generation if input images contain inappropriate
        content, and filters out unsafe generated images - the first blocked
        input image will fail the entire request.
      operationId: text-to-image-fast
      parameters:
        - in: path
          name: model_version
          schema:
            type: string
            enum:
              - '2.3'
          required: true
          description: The model version you would like to use in the request.
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    The prompt you would like to use to generate images. Bria
                    currently supports prompts in English only, excluding
                    special characters.
                num_results:
                  type: integer
                  description: How many images you would like to generate.
                  minimum: 1
                  maximum: 4
                  default: 4
                aspect_ratio:
                  type: string
                  description: >-
                    The aspect ratio of the image. The aspect ratio of the
                    image. When a ControlNet is being used, the aspect ratio is
                    defined by the guidance image and this parameter is ignored.
                  default: '1:1'
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                sync:
                  type: boolean
                  description: >-
                    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.
                  default: false
                seed:
                  type: integer
                  description: >-
                    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:
                  type: integer
                  description: >-
                    The number of iterations the model goes through to refine
                    the generated image. This parameter is optional.
                  minimum: 4
                  maximum: 10
                  default: 8
                medium:
                  type: string
                  enum:
                    - photography
                    - art
                  description: >-
                    Which medium should be included in your generated images.
                    This parameter is optional.
                prompt_enhancement:
                  type: boolean
                  description: >-
                    When set to true, enhances the provided prompt by generating
                    additional, more descriptive variations, resulting in more
                    diverse and creative output images. Note that turning this
                    flag on may result in a few additional seconds to the
                    inference time.
                  default: false
                content_moderation:
                  type: boolean
                  default: false
                  description: >
                    When enabled, applies content moderation to both input
                    visuals and generated outputs.


                    For input images:

                    - Processing stops at the first image that fails moderation

                    - Returns a 422 error with details about which parameter
                    failed


                    For synchronous requests (sync=true):

                    - If all generated images fail moderation, returns a 422
                    error

                    - If some images pass and others fail, returns a 200
                    response with successful generations and "blocked" objects
                    for failed ones


                    For asynchronous requests (sync=false):

                    - Failed images are replaced with zero-byte files at their
                    placeholder URLs

                    - Successful images are stored at their original placeholder
                    URLs
                guidance_method_1:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_1_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_1_image_file:
                  type: string
                  description: >-
                    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:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_2_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_2_image_file:
                  type: string
                  description: >-
                    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.
                image_prompt_mode:
                  type: string
                  enum:
                    - regular
                    - style_only
                  default: regular
                  description: >
                    - `regular`: Uses the image’s content, style elements, and
                    color palette to guide generation.

                    - `style_only`: Uses the image’s high-level style elements
                    and color palette to influence the generated output.
                image_prompt_file:
                  type: string
                  description: >
                    The image file to be used as guidance, in base64 format.
                    Accepted formats are jpeg, jpg, png, webp.

                    Maximum file size 12MB. This image can be of any aspect
                    ratio, even when it's not alligned with the one defined in
                    the parameter 'aspect_ratio' or by visuals provided to the
                    ControlNets.
                image_prompt_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: >
                    A list of URLs of images that should be used as guidance.
                    The images can be of different aspect ratios. Accepted
                    formats are jpeg, jpg, png, webp.

                    The URLs should point to accessible, publicly available
                    images.
                image_prompt_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: >
                    The impact of the provided image on the generated results. A
                    value between 0.0 (no impact) and 1.0 (full impact).
            example:
              prompt: a book
              num_results: 2
              sync: true
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
              examples:
                success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_222222.png
                        seed: 222222
                        uuid: some_uuid_222222
                partial_success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - blocked: true
                        error_code: '422'
                        description: >-
                          The request could not be completed because the
                          generated visual did not pass content moderation.
        '209':
          description: >-
            Successful operation, a model version that is no longer available
            was requested. The request was redirected to the latest model
            version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
        '400':
          description: Bad request.
        '403':
          description: Forbidden. Insufficient permissions to access the image URL..
        '405':
          description: Method not allowed.
        '415':
          description: >-
            Unsupported Media Type. Invalid file type. Supported file types are
            jpeg, jpg, png, webp.
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: string
              examples:
                input_violation:
                  value: >-
                    The request could not be completed because the visual in the
                    '{parameter_name}' parameter did not pass content
                    moderation.
                all_outputs_blocked:
                  value: >-
                    The request could not be completed because all generated
                    visuals did not pass content moderation.
                invalid_url:
                  value: >-
                    Unprocessable Entity. The URL does not point to a valid
                    image or is inaccessible.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
  /text-to-image/hd/{model_version}:
    post:
      summary: Generate Image - HD model
      tags:
        - Endpoints
      description: >-


        **Description**


        The /text-to-image/hd Route is dedicated for projects demanding the
        utmost in image detail and clarity. This model allows for generating
        high-quality, photorealistic and artistic, images with unparalleled
        resolution of 1920x1080 (1:1 1536x1536) pixel, supporting a variety of
        aspect ratios natively to accommodate diverse creative needs.


        **Examples:**


        **prompt**: A photo of detailed short female blond hair viewed from
        behind, with rich texture and clearly visible individual strands that
        give depth and realism, and featuring subtle waves reflect light


        **BRIA HD model 2.2:**


        <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/hd/seed_459779534.png"
        width="400"/> <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/hd/seed_939823113.png"
        width="400"/>


        **prompt**: A portrait of a Beautiful and playful ethereal singer, art
        deco, fantasy, intricate art deco golden designs, elegant, highly
        detailed, sharp focus, blurry background, teal and orange shades


        **BRIA HD model 2.2:**


        <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/hd/image+(42).png"
        width="400"/> <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/hd/image+(50).png"
        width="400"/>

        This API endpoint supports content moderation via an optional parameter
        that filters out unsafe generated images.
           
      operationId: text-to-image-hd
      parameters:
        - in: path
          name: model_version
          schema:
            type: string
            enum:
              - '2.2'
          required: true
          description: The model version you would like to use in the request.
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    The prompt you would like to use to generate images. Bria
                    currently supports prompts in English only, excluding
                    special characters.
                num_results:
                  type: integer
                  description: How many images you would like to generate.
                  minimum: 1
                  default: 4
                  maximum: 4
                aspect_ratio:
                  type: string
                  description: The aspect ratio of the image.
                  default: '1:1'
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                sync:
                  type: boolean
                  description: >-
                    Determines the response mode. When true, responses are
                    synchronous, and applicable to single-image requests. 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.
                  default: false
                seed:
                  type: integer
                  description: >-
                    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:
                  type: string
                  description: >-
                    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:
                  type: integer
                  description: >-
                    The number of iterations the model goes through to refine
                    the generated image. This parameter is optional.
                  minimum: 20
                  default: 30
                  maximum: 50
                text_guidance_scale:
                  type: number
                  format: float
                  description: >-
                    Determines how closely the generated image should adhere to
                    the input text description. This parameter is optional.
                  minimum: 1
                  maximum: 10
                  default: 5
                medium:
                  type: string
                  enum:
                    - photography
                    - art
                  description: >-
                    Which medium should be included in your generated images.
                    This parameter is optional.
                prompt_enhancement:
                  type: boolean
                  description: >-
                    When set to true, enhances the provided prompt by generating
                    additional, more descriptive variations, resulting in more
                    diverse and creative output images. Note that turning this
                    flag on may result in a few additional seconds to the
                    inference time.
                  default: false
                content_moderation:
                  type: boolean
                  default: false
                  description: >
                    When enabled, applies content moderation to generated
                    outputs.


                    For synchronous requests (sync=true):

                    - If all generated images fail moderation, returns a 422
                    error

                    - If some images pass and others fail, returns a 200
                    response with successful generations and "blocked" objects
                    for failed ones


                    For asynchronous requests (sync=false):

                    - Failed images are replaced with zero-byte files at their
                    placeholder URLs

                    - Successful images are stored at their original placeholder
                    URLs
            examples:
              valid prompt:
                value:
                  prompt: a book
                  num_results: 2
                  sync: true
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
              examples:
                success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_222222.png
                        seed: 222222
                        uuid: some_uuid_222222
                partial_success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - blocked: true
                        error_code: '422'
                        description: >-
                          The request could not be completed because the
                          generated visual did not pass content moderation.
        '209':
          description: >-
            Successful operation, a model version that is no longer available
            was requested. The request was redirected to the latest model
            version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
        '400':
          description: Bad request.
        '403':
          description: Forbidden. Insufficient permissions to access the image URL..
        '405':
          description: Method not allowed.
        '415':
          description: >-
            Unsupported Media Type. Invalid file type. Supported file types are
            jpeg, jpg, png, webp.
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: string
              examples:
                input_violation:
                  value: >-
                    The request could not be completed because the visual in the
                    '{parameter_name}' parameter did not pass content
                    moderation.
                all_outputs_blocked:
                  value: >-
                    The request could not be completed because all generated
                    visuals did not pass content moderation.
                invalid_url:
                  value: >-
                    Unprocessable Entity. The URL does not point to a valid
                    image or is inaccessible.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
  /text-to-vector/base/{model_version}:
    post:
      summary: Generate Vector Graphics - Base (Beta)
      tags:
        - Endpoints
      description: >-


        **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


        <img
        src="https://i.ibb.co/FBd4Cwj/sticker-of-a-cute-kitten-ec34b3c9918ecec1.png"
        width="200" height="200"/> <img
        src="https://i.ibb.co/dcNzBYR/kitten-2.png" width="200" height="200"/>
        <img src="https://i.ibb.co/WcgDjsx/kitten-4.png" width="200"
        height="200"/> <img src="https://i.ibb.co/YT66fGv/kitten-5.png"
        width="200" height="200"/>


        **prompt**: A beautiful butterfly


         <img src="https://i.ibb.co/1sRxRvp/butterfly-1.png" width="266" height="200"/><img src="https://i.ibb.co/Gxm7X9J/4-butterflies.png" width="266" height="200"/>


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

         This API endpoint supports content moderation via an optional parameter that can prevent generation if input images contain inappropriate content, and filters out unsafe generated images - the first blocked input image will fail the entire request.
      operationId: text-to-vector-base
      parameters:
        - in: path
          name: model_version
          schema:
            type: string
            enum:
              - '2.3'
          required: true
          description: The model version you would like to use in the request.
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    The prompt you would like to use to generate images. Bria
                    currently supports prompts in English only, excluding
                    special characters.
                num_results:
                  type: integer
                  description: >-
                    The aspect ratio of the image. When a ControlNet is being
                    used, the aspect ratio is defined by the guidance image and
                    this parameter is ignored.
                  minimum: 1
                  default: 4
                  maximum: 4
                aspect_ratio:
                  type: string
                  description: The aspect ratio of the image.
                  default: '1:1'
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                sync:
                  type: boolean
                  description: >-
                    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.
                  default: false
                seed:
                  type: integer
                  description: >-
                    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:
                  type: string
                  description: >-
                    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:
                  type: integer
                  description: >-
                    The number of iterations the model goes through to refine
                    the generated image. This parameter is optional.
                  minimum: 20
                  default: 30
                  maximum: 50
                text_guidance_scale:
                  type: number
                  format: float
                  description: >-
                    Determines how closely the generated image should adhere to
                    the input text description. This parameter is optional.
                  minimum: 1
                  maximum: 10
                  default: 5
                content_moderation:
                  type: boolean
                  default: false
                  description: >
                    When enabled, applies content moderation to both input
                    visuals and generated outputs.


                    For input images:

                    - Processing stops at the first image that fails moderation

                    - Returns a 422 error with details about which parameter
                    failed


                    For synchronous requests (sync=true):

                    - If all generated images fail moderation, returns a 422
                    error

                    - If some images pass and others fail, returns a 200
                    response with successful generations and "blocked" objects
                    for failed ones


                    For asynchronous requests (sync=false):

                    - Failed images are replaced with zero-byte files at their
                    placeholder URLs

                    - Successful images are stored at their original placeholder
                    URLs
                guidance_method_1:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_1_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_1_image_file:
                  type: string
                  description: >-
                    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:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_2_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_2_image_file:
                  type: string
                  description: >-
                    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.
                image_prompt_mode:
                  type: string
                  enum:
                    - regular
                    - style_only
                  default: regular
                  description: >
                    - `regular`: Uses the image’s content, style elements, and
                    color palette to guide generation.

                    - `style_only`: Uses the image’s high-level style elements
                    and color palette to influence the generated output.
                image_prompt_file:
                  type: string
                  description: >
                    The image file to be used as guidance, in base64 format.
                    Accepted formats are jpeg, jpg, png, webp.

                    Maximum file size 12MB. This image can be of any aspect
                    ratio, even when it's not alligned with the one defined in
                    the parameter 'aspect_ratio' or by visuals provided to the
                    ControlNets.
                image_prompt_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: >
                    A list of URLs of images that should be used as guidance.
                    The images can be of different aspect ratios. Accepted
                    formats are jpeg, jpg, png, webp.

                    The URLs should point to accessible, publicly available
                    images.
                image_prompt_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: >
                    The impact of the provided image on the generated results. A
                    value between 0.0 (no impact) and 1.0 (full impact).
            examples:
              valid prompt:
                value:
                  prompt: A simplistic flat icon of a megaphone
                  num_results: 2
                  sync: true
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
              examples:
                success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_222222.png
                        seed: 222222
                        uuid: some_uuid_222222
                partial_success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - blocked: true
                        error_code: '422'
                        description: >-
                          The request could not be completed because the
                          generated visual did not pass content moderation.
        '209':
          description: >-
            Successful operation, a model version that is no longer available
            was requested. The request was redirected to the latest model
            version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
        '400':
          description: Bad request.
        '403':
          description: Forbidden. Insufficient permissions to access the image URL..
        '405':
          description: Method not allowed.
        '415':
          description: >-
            Unsupported Media Type. Invalid file type. Supported file types are
            jpeg, jpg, png, webp.
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: string
              examples:
                input_violation:
                  value: >-
                    The request could not be completed because the visual in the
                    '{parameter_name}' parameter did not pass content
                    moderation.
                all_outputs_blocked:
                  value: >-
                    The request could not be completed because all generated
                    visuals did not pass content moderation.
                invalid_url:
                  value: >-
                    Unprocessable Entity. The URL does not point to a valid
                    image or is inaccessible.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
  /text-to-vector/fast/{model_version}:
    post:
      summary: Generate Vector Graphics - Fast (Beta)
      tags:
        - Endpoints
      description: >-


        **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


        <img src="https://i.ibb.co/DG73T97/bird-icon-1.png" width="200"
        height="200"/> <img src="https://i.ibb.co/WcySnrr/bird-icon-3.png"
        width="200" height="200"/> <img
        src="https://i.ibb.co/hsLcs04/bird-icon-2.png" width="200"
        height="200"/> <img src="https://i.ibb.co/6R99kxp/bird-icon-4.png"
        width="200" height="200"/>

        This API endpoint supports content moderation via an optional parameter
        that can prevent generation if input images contain inappropriate
        content, and filters out unsafe generated images - the first blocked
        input image will fail the entire request.
      operationId: text-to-vector-fast
      parameters:
        - in: path
          name: model_version
          schema:
            type: string
            enum:
              - '2.3'
          required: true
          description: The model version you would like to use in the request.
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    The prompt you would like to use to generate images. Bria
                    currently supports prompts in English only, excluding
                    special characters.
                num_results:
                  type: integer
                  description: How many images you would like to generate.
                  minimum: 1
                  maximum: 4
                  default: 4
                aspect_ratio:
                  type: string
                  description: >-
                    The aspect ratio of the image. When a ControlNet is being
                    used, the aspect ratio is defined by the guidance image and
                    this parameter is ignored.
                  default: '1:1'
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                sync:
                  type: boolean
                  description: >-
                    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.
                  default: false
                seed:
                  type: integer
                  description: >-
                    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:
                  type: integer
                  description: >-
                    The number of iterations the model goes through to refine
                    the generated image. This parameter is optional.
                  minimum: 4
                  maximum: 10
                  default: 8
                content_moderation:
                  type: boolean
                  default: false
                  description: >
                    When enabled, applies content moderation to both input
                    visuals and generated outputs.


                    For input images:

                    - Processing stops at the first image that fails moderation

                    - Returns a 422 error with details about which parameter
                    failed


                    For synchronous requests (sync=true):

                    - If all generated images fail moderation, returns a 422
                    error

                    - If some images pass and others fail, returns a 200
                    response with successful generations and "blocked" objects
                    for failed ones


                    For asynchronous requests (sync=false):

                    - Failed images are replaced with zero-byte files at their
                    placeholder URLs

                    - Successful images are stored at their original placeholder
                    URLs
                guidance_method_1:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_1_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_1_image_file:
                  type: string
                  description: >-
                    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:
                  type: string
                  enum:
                    - controlnet_canny
                    - controlnet_depth
                    - controlnet_recoloring
                    - controlnet_color_grid
                  description: >-
                    Which guidance type you would like to include in the
                    generation. Up to 2 guidance methods can be combined during
                    a single inference. This parameter is optional.
                guidance_method_2_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: The impact of the guidance.
                guidance_method_2_image_file:
                  type: string
                  description: >-
                    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.
                image_prompt_mode:
                  type: string
                  enum:
                    - regular
                    - style_only
                  default: regular
                  description: >
                    - `regular`: Uses the image’s content, style elements, and
                    color palette to guide generation.

                    - `style_only`: Uses the image’s high-level style elements
                    and color palette to influence the generated output.
                image_prompt_file:
                  type: string
                  description: >
                    The image file to be used as guidance, in base64 format.
                    Accepted formats are jpeg, jpg, png, webp.

                    Maximum file size 12MB. This image can be of any aspect
                    ratio, even when it's not alligned with the one defined in
                    the parameter 'aspect_ratio' or by visuals provided to the
                    ControlNets.
                image_prompt_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: >
                    A list of URLs of images that should be used as guidance.
                    The images can be of different aspect ratios. Accepted
                    formats are jpeg, jpg, png, webp.

                    The URLs should point to accessible, publicly available
                    images.
                image_prompt_scale:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: >
                    The impact of the provided image on the generated results. A
                    value between 0.0 (no impact) and 1.0 (full impact).
            examples:
              valid prompt:
                value:
                  prompt: A simplistic flat icon of a megaphone
                  num_results: 2
                  sync: true
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
              examples:
                success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_222222.png
                        seed: 222222
                        uuid: some_uuid_222222
                partial_success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - blocked: true
                        error_code: '422'
                        description: >-
                          The request could not be completed because the
                          generated visual did not pass content moderation.
        '209':
          description: >-
            Successful operation, a model version that is no longer available
            was requested. The request was redirected to the latest model
            version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
        '400':
          description: Bad request.
        '403':
          description: Forbidden. Insufficient permissions to access the image URL..
        '405':
          description: Method not allowed.
        '415':
          description: >-
            Unsupported Media Type. Invalid file type. Supported file types are
            jpeg, jpg, png, webp.
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: string
              examples:
                input_violation:
                  value: >-
                    The request could not be completed because the visual in the
                    '{parameter_name}' parameter did not pass content
                    moderation.
                all_outputs_blocked:
                  value: >-
                    The request could not be completed because all generated
                    visuals did not pass content moderation.
                invalid_url:
                  value: >-
                    Unprocessable Entity. The URL does not point to a valid
                    image or is inaccessible.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
  /reimagine:
    post:
      summary: Reimagine - Structure Reference
      tags:
        - Endpoints
      description: >-
        **Description**

        The `/reimagine` endpoint in Bria’s API allows guiding image generation
        not just with prompts but also by using an input image. This feature
        retains the original structure and depth of the input while
        incorporating new materials, colors, and textures to create fresh
        visuals.

        ### Key Benefits

        - **Simplified Structure Guidance**: Use a reference image to replicate
        its outline and depth, reducing the need for complex prompts and
        minimizing trial and error.


        - **Versatile Input/Output Pairings**:
            - Convert illustrations, sketches, or photos into new illustrative outputs.
            - Transform photos into variations that maintain the original layout.
            
        - **Adjustable Structure Influence**: Control how much the input image's
        structure impacts the output on a scale from 0 to 1, allowing for
        diverse creative results.


        - **Aspect Ratio Preservation**: Ensures the output maintains the
        reference image's aspect ratio for layout consistency. The output
        resolution is approximately 1 megapixel.


        - **Seamless Integration with Tailored Generation**: Combine structural
        references with tailored models to include unique IP characteristics in
        the generated outputs. At the moment, tailored models trained using the
        'Max' training version, are not supported in this endpoint.

        ### Potential Use Cases

        **Enhanced Creative Control for Platforms & Editing Tools**


        Empower creative platforms and editing tools with advanced levels of
        control and flexibility for generating visual content.

        - **Maintain Spatial Consistency**
          
          Structure reference image
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/Untitled+design+(10)+(1).png" width="200" height="200"/>
          
          
          Generated Visual (combined into a gif)
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/ezgif-3-6a1c2d26ed+(1).gif" width="200" height="200"/>
        - **Convert Sketches to Illustrations**
          
          Structure reference image
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/iStock-1507967542+(1).jpg" height="200"/>
          
          prompt: A watercolor painting of a lively urban street featuring a red vintage car parked in front of multi-story buildings, where soft, fluid brushstrokes capture the subtle gradients in the building facades, with warm earth tones blending into cool blues and grays for the shadows, giving the scene a nostalgic and dreamy atmosphere.
          
          structure_ref_influence: 0.75
          
          Generated Visual
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/A_watercolor_painting_of_a_lively_urban_street_featuring_a_red_vintage_car_parke_undefined+(2).png" height="200"/>
        - **Generate Diverse Variations**
          
          Structure reference image
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/cute-scottish-straight-kitten-playing-with-balls-o-2023-11-27-05-13-57-utc+(1)+(1).jpg" height="200"/>
          
          prompt: A ginger kitten sits on a textured beige surface, surrounded by soft balls of yarn.
          
          structure_ref_influence: 0.75
          
          Generated Visual
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/seed_1405021285.png" height="200"/>
        - **Stylize Typography and Logos**
          
          Structure reference image
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/BRIA+(1)+(1).png" width="200" height="200"/>
          
          prompt: curled orange peel.
          
          structure_ref_influence: 0.1
          
          Generated Visual
          
          <img src="https://bria-datasets.s3.us-east-1.amazonaws.com/api_doc/reimagine/curled_orange_peel_undefined+(1).png" width="200" height="200"/>

        **Interoperability with Tailored Generation**

        - **Reskin Gaming Assets**: Maintain the structure and detail of assets
        while updating textures and colors for fresh looks without altering the
        original shape or layout.


        - **Iterate on Gaming Asset Designs**: Simplifies design iteration for
        gaming assets, enabling rapid exploration and refinement.


        - **Customize Marketing Assets**: Transform marketing visuals while
        preserving their composition, adding new styles and elements with
        structural guidance.


        - **Adapt User-Generated Content**: Repurpose user-generated content for
        marketing campaigns, making it fit seamlessly with brand aesthetics.


        **For practical tips, view our guide
        [here](https://www.notion.so/134ba153467980a28d25de394f651c4a?pvs=21).**

        This API endpoint supports content moderation via an optional parameter
        that can prevent generation if input images contain inappropriate
        content, and filters out unsafe generated images - the first blocked
        input image will fail the entire request.
      operationId: reimagine-structure-reference
      parameters:
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                structure_image_url:
                  type: string
                  description: >-
                    A publicly available URL of the structure reference image.
                    If both structure_image_url and structure_image_file are
                    provided, structure_image_url will be used. Accepted formats
                    are jpeg, jpg, png, webp. Maximum file size 12MB.
                structure_image_file:
                  type: string
                  description: >-
                    The image file containing the structure reference, in base64
                    format. This parameter is used if structure_image_url is not
                    provided. Accepted formats are jpeg, jpg, png, webp. Maximum
                    file size 12MB.
                structure_ref_influence:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 0.75
                  description: >-
                    The influence of the structure reference on the generated
                    image. This parameter is optional. Higher value means more
                    adherence to the reference structure.
                prompt:
                  type: string
                  description: The text prompt describing the desired output image.
                num_results:
                  type: integer
                  description: >-
                    How many images you would like to generate. This parameter
                    is optional. When fast=false, only num_results=1 is
                    supported.
                  minimum: 1
                  default: 4
                  maximum: 4
                sync:
                  type: boolean
                  description: >-
                    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. This parameter is optional. When fast=false, it
                    is reomcmned to use sync=false.
                  default: true
                fast:
                  type: boolean
                  default: true
                  description: >-
                    Determines the generation mode. When true, the generation
                    will utilize the fast mode which provides the best balance
                    between speed and quality. When false, the regular mode will
                    be utilized.
                seed:
                  type: integer
                  description: >-
                    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 and other parameters. This
                    parameter is optional.
                content_moderation:
                  type: boolean
                  default: false
                  description: >
                    When enabled, applies content moderation to both input
                    visuals and generated outputs.


                    For input images:

                    - Processing stops at the first image that fails moderation

                    - Returns a 422 error with details about which parameter
                    failed


                    For synchronous requests (sync=true):

                    - If all generated images fail moderation, returns a 422
                    error

                    - If some images pass and others fail, returns a 200
                    response with successful generations and "blocked" objects
                    for failed ones


                    For asynchronous requests (sync=false):

                    - Failed images are replaced with zero-byte files at their
                    placeholder URLs

                    - Successful images are stored at their original placeholder
                    URLs
                tailored_model_id:
                  type: string
                  description: >-
                    The ID of the tailored model to use for generation. This
                    parameter is optional. At the moment, tailored models
                    trained using the 'Max' training version, are not supported
                    in this endpoint.
                tailored_model_influence:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1.5
                  default: 0.5
                  description: >-
                    The influence of the tailored model on the generation. Only
                    relevant if tailored_model_id is provided. This parameter is
                    optional. Higher value gives more weight to the tailored
                    model.
                include_generation_prefix:
                  type: boolean
                  default: true
                  description: >-
                    This is relevant only when a tailored model is being used.
                    When true, the model's generation prefix is automatically
                    prepended to your prompt to maintain consistency with the
                    training data, while false allows you to override the
                    training prefix and write the complete prompt yourself,
                    including any preferred prefix text.
                steps_num:
                  type: integer
                  description: >-
                    The number of iterations the model goes through to refine
                    the generated image. This parameter is optional. When
                    fast=false, the default value is 30, the minimum is 20 and
                    the maximum is 50.
                  minimum: 4
                  default: 12
                  maximum: 20
            examples:
              valid prompt:
                value:
                  prompt: a book
                  structure_image_url: URL
                  num_results: 2
                  sync: true
                  fast: true
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
              examples:
                success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_222222.png
                        seed: 222222
                        uuid: some_uuid_222222
                partial_success:
                  value:
                    result:
                      - urls: >-
                          https://storage.server/generate_image/some_uuid/seed_111111.png
                        seed: 111111
                        uuid: some_uuid_111111
                      - blocked: true
                        error_code: '422'
                        description: >-
                          The request could not be completed because the
                          generated visual did not pass content moderation.
        '209':
          description: >-
            Successful operation, a model version that is no longer available
            was requested. The request was redirected to the latest model
            version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: >-
                      There are multiple objects in this array (based on the
                      amount specified in num_results) and each object
                      represents a single image or a blocked result.
                    items:
                      oneOf:
                        - type: object
                          properties:
                            seed:
                              type: integer
                              description: >-
                                If you want to recreate the result again, you
                                should use in the request the prompt and the
                                seed of the response.
                            urls:
                              type: string
                              description: >-
                                This is the URL where the generated image can be
                                found. It will take a few seconds for the image
                                to become available via this URL if sync=false.
                            uuid:
                              type: string
                        - type: object
                          properties:
                            blocked:
                              type: boolean
                            error_code:
                              type: string
                            description:
                              type: string
        '400':
          description: Bad request.
        '403':
          description: Forbidden. Insufficient permissions to access the image URL..
        '404':
          description: Not Found. Model with the specified ID does not exist
        '405':
          description: Method not allowed.
        '415':
          description: >-
            Unsupported Media Type. Invalid file type. Supported file types are
            jpeg, jpg, png, webp.
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: string
              examples:
                input_violation:
                  value: >-
                    The request could not be completed because the visual in the
                    '{parameter_name}' parameter did not pass content
                    moderation.
                all_outputs_blocked:
                  value: >-
                    The request could not be completed because all generated
                    visuals did not pass content moderation.
                invalid_url:
                  value: >-
                    Unprocessable Entity. The URL does not point to a valid
                    image or is inaccessible.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
  /prompt_enhancer:
    post:
      summary: Prompt enhancement
      tags:
        - Endpoints
      description: >-


        **Description**


        The /prompt_enhancer route is designed to boost users' creativity by
        transforming simple prompts into more detailed and vivid descriptions.
        This helps generate richer, more diverse images. (It is also available
        as a built-in flag in all of our /text-to-image routes, excluding
        tailored generation.)


        We recommend using this feature by offering users a range of prompts to
        choose from before generating an image, enabling them to explore
        creative ideas.


        *Works best with short to medium prompts of up to approximately 50
        words.


        **Examples:**


        **original prompt**: A cat


        <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/prompt_enhancement/cat_orig.png"
        width="200" height="200"/> 


        **enhanced prompt**: A black and white photograph of a sophisticated
        Siamese cat, sitting in a chair next to a large window, with the urban
        cityscape visible in the background


        <img
        src="https://bria-datasets.s3.amazonaws.com/api_doc/prompt_enhancement/cat_bw.png"
        width="200" height="200"/>
      operationId: prompt-enhancer
      parameters:
        - in: header
          name: api_token
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: The original prompt that to enhance.
            examples:
              valid prompt:
                value:
                  prompt: an old man fishing
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: string
                    description: the new enhanced prompt
              examples:
                valid prompt:
                  value:
                    results:
                      prompt variations: >-
                        A close-up, detailed illustration of a fluffy white cat
                        sitting on a windowsill, with its eyes wide open,
                        surrounded by soft, warm light, and a few books
                        scattered nearby
        '400':
          description: Bad request.
        '429':
          description: >-
            Request limit exceeded. Your account has reached its maximum allowed
            requests. Please upgrade your plan or try again later.
        '500':
          description: Internal server error.
components: {}
