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 (FIBO Models)
    • Required for fibo training versions
    • Use /tailored-gen/generate_visual_schema to create a structured visual schema using 5-10 sample images.
  • Generate Caption Prefix (Legacy Models)
    • Use /tailored-gen/generate_prefix to create a text-based prefix for legacy training versions.
  • 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).
  • Choose Training version: Select "Fibo" for best results.
  • 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 v2/image/generate/tailored (FIBO) or v1/text-to-image/tailored (Legacy).
  • Structured Prompting: Use v2/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 and version.
  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
https://engine.prod.bria-api.com/v1

Project

Manage your projects

Operations

Dataset

Manage training datasets

Operations

Advanced image upload

Request

Efficiently upload a large volume of images (up to 5000) from a ZIP file to an advanced dataset.

FIBO Specific Behavior:

  • Upload without Schema: You CAN initiate a bulk upload to a FIBO dataset even if visual_schema is null.
  • Captioning: If the schema is missing, images will be uploaded but caption generation will be skipped. You must call Regenerate All Captions after defining the schema.
  • ZIP Content: Should contain images only. Text files are ignored.

Legacy Specific Behavior:

  • ZIP Content: Can contain images and optional .txt caption files.
  • Captioning: Uses automatic_captioning flag or provided text files.

General:

  • Asynchronous operation; status can be retrieved via {dataset_id}/bulk-upload/status.
  • Supported for 'advanced' upload type datasets only.
  • This endpoint is for bulk upload and does not support the increase_resolution parameter.
  • Images that fail validation (e.g., unsupported format, wrong dimensions, missing captions) will be skipped and included in the failure report.
  • If the dataset is not empty, if another bulk upload is in progress, or if any previous bulk upload attemp took place, the request will fail.

Image Requirements:

  • Supported formats: jpg, jpeg, png, webp.
  • Minimum dimensions: 1024 x 1024 pixels.
  • Total size limit: 5 GB zip file.
Path
dataset_idintegerrequired

The ID of the dataset to upload images to. Must be an 'advanced' dataset.

Headers
api_tokenstringrequired
Bodyapplication/jsonrequired
zip_urlstring(uri)

The publicly accessible URL of the ZIP file to upload.

automatic_captioningboolean

(Legacy only) Controls automatic caption generation.

Default true
content_moderationboolean

When enabled, applies content moderation to input visuals.

Default false
curl -i -X POST \
  'https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images/bulk-upload' \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "zip_url": "http://example.com",
    "automatic_captioning": true,
    "content_moderation": false
  }'

Responses

Bulk upload job started successfully.

Response
No content

Get Image by ID

Request

Retrieve full image information including caption (which naturally continues the dataset's caption_prefix), caption source (automatic/manual/unknown), image name, URL and thumbnail URL, dataset ID, and timestamps.

Path
dataset_idintegerrequired

Dataset ID

image_idintegerrequired

Image ID

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

Responses

Successfully retrieved image

Bodyapplication/json
idinteger

Unique identifier for the image

dataset_idinteger

ID of the dataset this image belongs to

captionstring

Caption describing the image

caption_sourcestring

Source of the caption. 'unknown' value only appears for images that were uploaded using an old version of Tailored Generation.

Enum"automatic""manual""unknown"
image_namestring

Name of the image

image_urlstring

URL of the original image file

thumbnail_urlstring

URL of the image thumbnail

created_atstring(date-time)

Timestamp when the image was created

updated_atstring(date-time)

Timestamp when the image was last updated

Response
application/json
{ "id": 789, "dataset_id": 456, "caption": "standing in a confident pose wearing a blue dress", "caption_source": "automatic", "image_name": "lora_standing.png", "image_url": "https://api.example.com/files/lora_standing.png", "thumbnail_url": "https://api.example.com/files/lora_standing_thumb.png", "created_at": "2024-05-26T12:30:00Z", "updated_at": "2024-05-26T12:30:00Z" }

Update Image Caption

Request

Update the caption of a specific image. There are two mutually exclusive ways to update a caption:

  1. Provide a new caption text:

    • Use the caption parameter
    • This will set caption_source to "manual"
    • Reflects a human-written caption
  2. Request automatic caption regeneration:

    • Set regenerate_caption to true
    • This will set caption_source to "automatic"
    • A new caption will be generated automatically based on the image and caption_prefix (or visual_schema for FIBO)

FIBO Dataset Validation: If the image belongs to a dataset with training_version = fibo:

  • The caption string must contain a valid JSON structure.
  • The JSON content is validated against a pre-defined caption schema.
  • The system will attempt to auto-correct minor structural issues.
  • If the JSON is invalid or structurally incorrect beyond repair, a 400 error is returned.

Constraints:

  • Cannot update captions in a completed dataset
  • Cannot provide both caption and regenerate_caption in the same request
Path
dataset_idintegerrequired

Dataset ID

image_idintegerrequired

Image ID

Headers
api_tokenstringrequired
Bodyapplication/jsonrequired
captionstring

New caption text. When provided, sets caption_source to "manual".

  • For legacy datasets: Standard text string.
  • For FIBO datasets: String containing valid JSON structure.
regenerate_captionboolean

When true, generates new caption automatically and sets caption_source to "automatic"

Default false
curl -i -X PUT \
  'https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images/{image_id}' \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "caption": "standing confidently in a defensive pose wearing armor"
  }'

Responses

Caption successfully updated

Bodyapplication/json
idinteger

Unique identifier for the image

dataset_idinteger

ID of the dataset this image belongs to

captionstring

Updated caption for the image

caption_sourcestring

Source of the updated caption

Enum"automatic""manual"
image_namestring

Name of the image

image_urlstring

URL of the original image file

thumbnail_urlstring

URL of the image thumbnail

created_atstring(date-time)

Timestamp when the image was created

updated_atstring(date-time)

Timestamp when the image was last updated

Response
application/json
{ "id": 789, "dataset_id": 456, "caption": "standing confidently in a defensive pose wearing armor", "caption_source": "manual", "image_name": "lora_standing.png", "image_url": "https://api.example.com/files/lora_standing.png", "thumbnail_url": "https://api.example.com/files/lora_standing_thumb.png", "created_at": "2024-05-26T12:30:00Z", "updated_at": "2024-05-26T15:45:00Z" }

Model

Manage and train models

Operations

Image Generation V2

Generation using FIBO models

Operations

Image Generation (Legacy)

Generation using Legacy models

Operations

Video Generation

Image-to-Video capabilities

Operations