Manage your projects
- Generate Visual Schema
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:
- Project Management: Create and manage projects that define IP characteristics:
- Create and Retrieve Projects: Use the
/projectsendpoints 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.
- Dataset Management: Organize and refine datasets within your projects:
- Create and Retrieve Datasets: Use the
/datasetsendpoints to create new datasets or retrieve existing ones. - Generate a Visual Schema (FIBO Models)
- Required for
fibotraining versions - Use
/tailored-gen/generate_visual_schemato create a structured visual schema using 5-10 sample images.
- Required for
- Generate Caption Prefix (Legacy Models)
- Use
/tailored-gen/generate_prefixto create a text-based prefix for legacy training versions.
- Use
- Refine Structured Data
- Use
/tailored-gen/refine_structured_promptto 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.
- Use
- Upload and Manage Images:
- Basic upload: Use
/datasets/{dataset_id}/imagesto upload up to 200 images individually. - Bulk upload: Use
/datasets/{dataset_id}/images/bulkto upload zip files with >200 high-quality images (Advanced).
- Basic upload: Use
- Clone Datasets: Create variations of existing datasets using the clone functionality.
- Model Management: Train and optimize tailored models based on your datasets:
- Create and Retrieve Models: Use the
/modelsendpoints 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.
- Generation Capabilities:
- Image Generation: Use
v2/image/generate/tailored(FIBO) orv1/text-to-image/tailored(Legacy). - Structured Prompting: Use
v2/structured_prompt/generate/tailoredto create structured prompts via VLM before generation. - Video Generation: Use
/video/generate/tailored/image-to-videoto animate tailored images.
To train a tailored model:
- Create a Project: Use the
/projectsendpoint to define your IP type and medium. - Create a Dataset: Use the
/datasetsendpoint to create a dataset within your project. - 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_promptwith 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}.
- Step A (Generate): Call
- Upload Images: Upload images using the
/datasets/{dataset_id}/imagesor/datasets/{dataset_id}/images/bulkendpoints (minimum resolution: 1024x1024px). - Prepare Dataset: Review auto-generated captions (you can also use
refine_structured_promptto fix specific image captions) and update the dataset status to 'completed'. - Create Model: Use the
/modelsendpoint to create a model, which requires a training mode and version. - Start Training: Initiate training via the
/models/{id}/start_trainingendpoint. Training typically takes 4-6 hours. - Monitor Progress: Check the training status using the
/models/{id}endpoint until training is 'Completed'. - Generate Images:
- Use
v2/image/generate/tailoredfor text-to-image generation.
Alternatively, manage and train tailored models through Bria's user-friendly Console.
Get started here.
- https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images/bulk-upload/status
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images/bulk-upload/status' \
-H 'api_token: string'- in_progress
- completed_with_failures
{ "status": "processing", "progress_percentage": 50, "total_processed": 100, "done": 45, "failed": 5, "failed_images": [ { "filename": "photo1.bmp", "error_code": 415, "error_message": "Unsupported file format for image: photo1.bmp" }, { "filename": "photo2.jpg", "error_code": 412, "error_message": "Image resolution must be at least 1024x1024: photo2.jpg" } ] }
Request
Generates a structured JSON visual schema (backbone) based on the provided sample images.
This endpoint is required for datasets intended for the FIBO training version. The visual schema represents mutual characteristics (style, IP, colors, etc.) across training images and is used for:
- Caption generation during image upload.
- Prompt translation (user text → structured prompt) during generation.
Usage:
- Provide 5-10 representative images of your style/IP.
- The returned
visual_schemastring must be added to your dataset using thePUT /tailored-gen/datasets/{dataset_id}endpoint.
This API endpoint supports content moderation via an optional parameter.
An array of 5-10 images. Supports base64-encoded strings or public URLs. Supported formats: png, jpg, jpeg, webp.
- https://engine.prod.bria-api.com/v1/tailored-gen/generate_visual_schema
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v1/tailored-gen/generate_visual_schema \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"images": [
"/9j/4AAQSkZJRgABAQAAAQABAAD...",
"/9j/4AAQSkZJRgABAQAAAQABAAD...",
"/9j/4AAQSkZJRgABAQAAAQABAAD...",
"/9j/4AAQSkZJRgABAQAAAQABAAD...",
"/9j/4AAQSkZJRgABAQAAAQABAAD..."
],
"content_moderation": true
}'{ "visual_schema": "{\"style\": \"...\", \"colors\": \"...\"}" }
Request
Refines a Structured Prompt object (such as a Visual Schema or an Image Caption) based on user instructions.
Access Control & Validation:
- Dataset Ownership: Requires a valid
dataset_idto verify that the API token belongs to the organization owning the dataset. - Draft Status: The referenced dataset must be in
draftmode. Refinement is disabled for completed datasets.
Use Cases:
- Refine Visual Schema: Input the initial schema generated by Bria and instructions like "Make the style description more detailed".
- Refine Image Caption: Input a specific image's caption and instructions like "Fix the description of the hair color".
The endpoint uses a VLM/LLM to process the input JSON and instructions, returning a valid, modified JSON structure that preserves the required format.
The ID of the dataset associated with this refinement. Used to validate ownership and draft status.
The current structured prompt string (Visual Schema or Caption) to be refined.
Natural language instruction describing how to modify the JSON (e.g., "Add a field for mood", "Correct the object color").
- https://engine.prod.bria-api.com/v1/tailored-gen/refine_structured_prompt
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v1/tailored-gen/refine_structured_prompt \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"dataset_id": 456,
"structured_prompt": "{\"style\": \"cartoon\", \"colors\": [\"red\", \"blue\"]}",
"instruction": "Change the style to '\''realistic 3D render'\'' and remove blue from colors."
}'{ "structured_prompt": "string" }