---
title: "Upload Image"
method: POST
path: "/tailored-gen/datasets/{dataset_id}/images"
tags: ["Tailored Generation"]
---

# Upload Image

`POST /tailored-gen/datasets/{dataset_id}/images`

Upload new image to a dataset. 

Image Requirements:
- Minimum resolution: 1024x1024 pixels
- Supported formats: jpg, jpeg, png, webp
- Preferably use original high-quality assets
- For best results, use 1:1 aspect ratio or ensure main content is centered

Dataset Guidelines:
- Recommended: 5-50 images for optimal results when using Max training version, 15-100 for optimal results when using Light training version
- Maximum supported: 200 images
- Ensure consistency in style, structure, and visual elements
- Balance diversity in content (poses, scenes, objects) while maintaining consistency in key elements (style, colors, theme)
- Note: Larger datasets may introduce more variety, which can reduce overall consistency

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

Captions and Generation:
- Each image receives an automatic caption that continues from the dataset's caption prefix
- Default caption prefix is recommended for initial training
- Captions can be modified to include domain-specific terms
- Both captions and prefix influence training and future generations
- Focus on essential elements rather than extensive details

Constraints:
- Dataset must have at least 1 image
- Dataset cannot exceed 200 images
- Cannot upload to a completed dataset

## Path parameters

- `dataset_id` string, required

## Headers

- `api_token` string, required

## Request body

- object
  - `file` string, binary — Image file to upload (required if image_url not provided)
  - `image_url` string — URL of image to upload (required if file not provided)
  - `image_name` string — Custom name for the image (optional)

## Response `201`

Image successfully uploaded

- object
  - `id` integer — Unique identifier for the image
  - `dataset_id` integer — ID of the dataset this image belongs to
  - `caption` string — Once an image is uploaded, a caption is generated automatically. The caption is a natural continuation of the caption_prefix.
  - `caption_source` 'automatic' | 'manual' — Source of the caption
  - `image_name` string — Name of the image
  - `file` string — file of the original image file in base64 format. Either file or image_url should be provided, not both.
  - `image_url` string — URL of the original image file.
  - `thumbnail_url` string — URL of the image thumbnail
  - `created_at` string, date-time — Timestamp when the image was created
  - `updated_at` string, date-time — Timestamp when the image was last updated

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Dataset not found
- `409` — Conflict error
- `412` — Precondition Failed.
- `415` — Unsupported Media Type.
- `422` — Unprocessable Entity.
- `429` — Request limit exceeded. Your account has reached its maximum allowed requests. Please upgrade your plan or try again later.
- `500` — Internal server error

---

[API](https://skmtc.net/bria-ai/apis/the-bria-api.md) · [All operations](https://skmtc.net/bria-ai/apis/the-bria-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bria-ai/the-bria-api/revisions/2768230345a5/schema)
