v1
latestOpenAPI 3.0.02026-07-13650400.5 KBGenerate Image - Tailored model
Description This route allows you to generate images using a Tailored Model. Tailored models are trained on a visual IP (illustrations, photos, vectors) to faithfully reproduce specific IP elements or guidelines. You can train an engine through our Console or implement training on your platform via API.
Overview of Tailored Generation Training API 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 which define the 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 (currently illustration, with photography coming soon).
- Manage Project Details: Use the /projects/{id} endpoints to update or delete specific projects.
-
Dataset Management: Create and manage datasets within your projects. You can:
- Create and Retrieve Datasets: Use the /datasets endpoints to create new datasets or retrieve existing ones.
- Upload and Manage Images: Use the /datasets/{dataset_id}/images endpoints to upload images and manage their captions.
- Clone Datasets: Create variations of existing datasets using the clone functionality.
-
Model Management: Create and train models based on your datasets:
- Create and Retrieve Models: Use the /models endpoints to create new models or list existing ones.
- Choose Training Version: Select between "light" (for fast generation and structure reference compatibility) or "max" (for superior prompt alignment and enhanced learning capabilities).
- Monitor and Control: Manage the model lifecycle including training start/stop and status monitoring.
Training Process Overview
To train a tailored model:
-
Create a Project: Use the /projects endpoint to create a project and define your IP type and medium.
-
Create a Dataset: Use the /datasets endpoint to create a dataset within your project.
-
Upload Images: Upload images to your dataset using the /datasets/{dataset_id}/images endpoint. Images must be 1024x1024px minimum.
-
Prepare Dataset: Review auto-generated captions and use the /datasets/{id} endpoint to set status to 'completed'.
-
Create Model: Use the /models endpoint to create a model, selecting light or max training version.
-
Start Training: Initiate training using the /models/{id}/start_training endpoint. Training takes 1-3 hours.
-
Monitor Progress: Check training status using the /models/{id} endpoint until status shows 'Completed'.
-
Generate Images: Once trained, your model can be used in multiple ways:
- Use the /text-to-image/tailored/{model_id} endpoint for text-to-image generation
- Use the /text-to-vector/tailored/{model_id} endpoint for generating illustrative vector graphics
- Use the /reimagine/tailored/{model_id} endpoint for generating using a structure reference images
- Access through the Bria platform interface
Alternatively, you can use the Bria platform to manage and train your tailored models through a user-friendly interface. Access the Bria platform here.
Guidance Methods
This API supports various guidance methods to provide greater control over text-to-image generation. These methods condition the model on additional inputs derived from user-provided images.
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.
Using ControlNets
You can specify up to four 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. The table below provides detailed information about each guidance method, with an example os use:
To use ControlNets guidance method, include the following parameters in your request:
-
guidance_method_X: Specify the guidance method (where X is 1, 2). If the paramter guidance_method_2 is used, so does guidance_method_1 has to be used, and so on. If you would like to use only one method, use the paratmer guidance_method_1
-
guidance_method_X_scale: Set the impact of the guidance (0.0 to 1.0)
-
guidance_method_X_image_file: Provide the base64-encoded input image IP_adapter:
Guides the model based on the input image and its associated style. This method offers two modes:
- regular: Uses the full input image to condition the model, influencing both content and style.
- style_only: Focuses only on the style of the input image, allowing the model to generate images based on the provided aesthetic without altering the content.
Using IP-Adapter <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>IP-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?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2" alt="Input Image" style="width: 150px; height: 150px; object-fit: contain;"></td> <td style="width: 150px;"><img src="https://bria-datasets.s3.us-east-1.amazonaws.com/temp_exp_or/image.png" alt="Output Image" style="width: 150px; height: 150px; object-fit: contain;"></td> </tr> <tr> <td>IP-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" alt="Input Image" style="width: 150px; height: 150px; object-fit: contain;"></td> <td style="width: 150px;"><img src="https://bria-datasets.s3.us-east-1.amazonaws.com/temp_exp_or/seed_627499055.png" alt="Output Image" style="width: 150px; height: 150px; object-fit: contain;"></td> </tr> </table>Path parameters
The model id of the tailored model you would like to use in the request.
Headers
Request body
Response
Successful operation.