Skip to content

Overview

Tailored Generation provides capabilities to generate visuals (photos, illustrations, vectors) that preserve and faithfully reproduce specific IP elements or guidelines, ensuring consistency across all generated outputs.

The Tailored Generation APIs allow you to manage and train tailored models that maintain the integrity of your visual IP. You can train models through our Console or implement training directly via API. Explore the Console here.

Fully Automated Training Mode Bria supports users in training high-quality finetuned models without the guesswork. Based on the selected IP type & dataset, Bria automatically selects the right training parameters. This means that the user only needs to spend time curating their dataset.

Advanced Customization and Access: Bria offers 2 types of advanced training customization: Expert training mode and source-code & weights.

  • Expert training mode is for LoRa Finetune experts and provides the ability to finetune training parameters and upload larger training datasets.
  • Source-code & Weights is for developers seeking deeper customization and access to Bria's source-available GenAI models via Hugging Face.

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

The Tailored Generation Training API provides a set of endpoints to manage the entire lifecycle of a tailored generation project:

  1. Project Management: Create and manage projects that define IP characteristics:
  • Create and Retrieve Projects: Use the /projects endpoints to create a new project or retrieve existing projects that belong to your organization.
  • Define IP Type: Specify the IP type (e.g., multi_object_set, defined_character, stylized_scene) and medium.
  • Manage Project Details: Use the /projects/{id} endpoints to update or delete specific projects.
  1. Dataset Management: Organize and refine datasets within your projects:
  • Create and Retrieve Datasets: Use the /datasets endpoints to create new datasets or retrieve existing ones.
  • Generate a Visual Schema
    • Use /tailored-gen/generate_visual_schema to create a structured visual schema using 5-10 sample images.
  • Refine Structured Data
    • Use /tailored-gen/refine_structured_prompt to iterate on your Visual Schema or Image Captions using natural language instructions.
    • Example: You can send your generated schema with the instruction "Character's name is Lucy" to improve the training metadata programmatically.
  • Upload and Manage Images:
    • Basic upload: Use /datasets/{dataset_id}/images to upload up to 200 images individually.
    • Bulk upload: Use /datasets/{dataset_id}/images/bulk to upload zip files with >200 high-quality images (Advanced).
  • Clone Datasets: Create variations of existing datasets using the clone functionality.
  1. Model Management: Train and optimize tailored models based on your datasets:
  • Create and Retrieve Models: Use the /models endpoints to create new models or list existing ones.
  • Choose training mode: Select between Fully automated mode (automatic training based on Bria's recipes) and Expert mode (for training parameter tweaking).
  • Monitor and Control: Manage the model lifecycle, including training start/stop, status monitoring, and version control over the training parameters.
  1. Generation Capabilities:
  • Image Generation: Use /image/generate/tailored for text-to-image generation.
  • Structured Prompting: Use /structured_prompt/generate/tailored to create structured prompts via VLM before generation.
  • Video Generation: Use /video/generate/tailored/image-to-video to animate tailored images.

Training Process

To train a tailored model:

  1. Create a Project: Use the /projects endpoint to define your IP type and medium.
  2. Create a Dataset: Use the /datasets endpoint to create a dataset within your project.
  3. Define Visual Identity:
    • Step A (Generate): Call /tailored-gen/generate_visual_schema, sampling 5-10 images from your input set.
    • Step B (Refine - Optional): Call /tailored-gen/refine_structured_prompt with the generated schema and instructions to tweak the definitions (e.g., "Remove references to blue background").
    • Step C (Apply): Update the dataset with the final schema using /datasets/{dataset_id}.
  4. Upload Images: Upload images using the /datasets/{dataset_id}/images or /datasets/{dataset_id}/images/bulk endpoints (minimum resolution: 1024x1024px).
  5. Prepare Dataset: Review auto-generated captions (you can also use refine_structured_prompt to fix specific image captions) and update the dataset status to 'completed'.
  6. Create Model: Use the /models endpoint to create a model, which requires a training mode.
  7. Start Training: Initiate training via the /models/{id}/start_training endpoint. Training typically takes 4-6 hours.
  8. Monitor Progress: Check the training status using the /models/{id} endpoint until training is 'Completed'.
  9. Generate Images:
  • Use v2/image/generate/tailored for text-to-image generation.

Alternatively, manage and train tailored models through Bria's user-friendly Console.
Get started here.

Languages
Servers
https://engine.prod.bria-api.com/v2

Project

Manage your projects

Operations

Dataset

Manage training datasets

Operations

Clone Dataset As Draft

Request

Create a new draft dataset based on an existing one. This is useful when you would like to use the same dataset again for another training, but with some modification (create a variation). The cloned dataset inherits the visual_schema from the source dataset.

Path
dataset_idintegerrequired
Headers
api_tokenstringrequired
Bodyapplication/json
namestring

New dataset name. Defaults to "Copy of [original name]"

descriptionstring

New dataset description.

curl -i -X POST \
  'https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/clone' \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "name": "Copy of dataset v1 - modified version",
    "description": "Modified version with additional poses"
  }'

Responses

Dataset successfully cloned

Bodyapplication/json
idinteger
project_idinteger
namestring
visual_schemastring or null
statusstring
Value"draft"
captions_update_statusstring
Enum"empty""in_progress""completed"
upload_typestring
Enum"basic""advanced"
images_countinteger
imagesArray of objects
images[].​idinteger
images[].​dataset_idinteger
images[].​captionstring
images[].​caption_sourcestring
Value"automatic"
images[].​image_namestring
images[].​image_urlstring
images[].​thumbnail_urlstring
images[].​created_atstring(date-time)
images[].​updated_atstring(date-time)
created_atstring(date-time)
updated_atstring(date-time)
Response
application/json
{ "id": 0, "project_id": 0, "name": "string", "visual_schema": "string", "status": "draft", "captions_update_status": "empty", "upload_type": "basic", "images_count": 0, "images": [ { "id": 0, "dataset_id": 0, "caption": "string", "caption_source": "automatic", "image_name": "string", "image_url": "string", "thumbnail_url": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }

Upload Image Files

Request

Upload a new image to a dataset.

Image Requirements:

  • Recommended minimum resolution: 1024x1024 pixels for best quality
    • By default, smaller images (down to 256x256) will be automatically upscaled (increase_resolution=true)
    • To strictly enforce the 1024x1024 minimum, set increase_resolution=false
  • Supported formats: jpg, jpeg, png, webp
  • Preferably use original high-quality assets

Dataset Guidelines:

  • Recommended: 5-50 images for optimal results
  • Maximum supported: 200 images
  • Ensure consistency in style, structure, and visual elements
  • Balance diversity in content while maintaining consistency in key elements

For optimal training (especially for characters/objects):

  • Subject should occupy most of the image area
  • Minimize unnecessary margins around the subject
  • Transparent backgrounds will be converted to black
  • For character datasets: include diverse poses, environments, attires, and interactions

Constraints:

  • Can only be used by "basic" upload type datasets. Use images/bulk for advanced datasets.
  • Dataset must have at least 5 images
  • Dataset cannot exceed 200 images
  • Cannot upload to a completed dataset

This API endpoint supports content moderation via an optional parameter.

Path
dataset_idintegerrequired
Headers
api_tokenstringrequired
Bodyapplication/jsonrequired
filestring(binary)

Image file to upload (required if image_url not provided)

image_urlstring

URL of image to upload (required if file not provided)

image_namestring

Custom name for the image (optional)

increase_resolutionboolean

When enabled (default), input images smaller than 1024x1024 but larger than 256x256 will be automatically upscaled. If false, images must be at least 1024x1024 pixels.

Default true
content_moderationboolean
Default false
curl -i -X POST \
  'https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images' \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "image_url": "https://example.com/images/character_pose.jpg",
    "image_name": "character_standing_pose.jpg"
  }'

Responses

Image successfully uploaded

Bodyapplication/json
idinteger
dataset_idinteger
captionstring or null

The generated caption. Null if uploaded without a visual schema.

caption_sourcestring or null
Enum"automatic""manual""pending"
image_namestring
image_urlstring
thumbnail_urlstring
created_atstring(date-time)
updated_atstring(date-time)
Response
application/json
{ "id": 0, "dataset_id": 0, "caption": "string", "caption_source": "automatic", "image_name": "string", "image_url": "string", "thumbnail_url": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }

Get Images

Request

Retrieve all images in a specific dataset.

Path
dataset_idintegerrequired
Headers
api_tokenstringrequired
curl -i -X GET \
  'https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images' \
  -H 'api_token: string'

Responses

Successfully retrieved images

Bodyapplication/jsonArray [
idinteger
dataset_idinteger
captionstring
caption_sourcestring
Enum"automatic""manual"
image_namestring
image_urlstring
thumbnail_urlstring
created_atstring(date-time)
updated_atstring(date-time)
]
Response
application/json
[ { "id": 0, "dataset_id": 0, "caption": "string", "caption_source": "automatic", "image_name": "string", "image_url": "string", "thumbnail_url": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ]

Model

Manage and train models

Operations

Image Generation

Generate images using tailored models

Operations

Video Generation

Image-to-Video capabilities

Operations