# Upload Image Files

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.

Endpoint: POST /tailored-gen/datasets/{dataset_id}/images

## Path parameters:

  - `dataset_id` (integer, required)

## Header parameters:

  - `api_token` (string, required)

## Request fields (application/json):

  - `file` (string)
    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)

  - `increase_resolution` (boolean)
    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.

  - `content_moderation` (boolean)

## Response 201 fields (application/json):

  - `id` (integer)

  - `dataset_id` (integer)

  - `caption` (string,null)
    The generated caption. Null if uploaded without a visual schema.

  - `caption_source` (string,null)
    Enum: "automatic", "manual", "pending"

  - `image_name` (string)

  - `image_url` (string)

  - `thumbnail_url` (string)

  - `created_at` (string)

  - `updated_at` (string)


## Response 400 fields

## Response 401 fields

## Response 403 fields

## Response 404 fields

## Response 409 fields

## Response 412 fields

## Response 415 fields

## Response 422 fields

## Response 429 fields

## Response 500 fields
