Finetune

APIs for training new model.

Create Finetune

This endpoint will start the training of a LoRA model for Flux Pro and returns its associated unique trigger word.

SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_files
Array of strings <binary> (Image Files)

Images to be uploaded for training. For FluxFintune and FluxProFintune, providing a few images of the desired object/person/style will usually suffice. In case of FluxKontextFinetune, images should be provided in pairs. For each pair, the first image will be used as 'start' and the second image as 'end' for the training. Where the 'end' image contains the desired outcome of applying the edit described in 'prompt' to the 'start' image.

image_urls
Array of strings (Image URLs)
Default: []

Alternatively you can provide URLs of the training image files. If you upload image files, this field will be ignored.

num_iterations
integer (Number of training iterations. Defaults to 0 for Auto. In Auto mode the actual values for )
Default: 0
option
string (Option)
Default: "FluxFinetune"

Training option to finetune based on your images. Available values are FluxFinetune, FluxProFinetune, FluxKontextFinetune.

finetune_type
string (Finetune Type)
Default: "Auto"

Override finetune type. Finetune type can be Auto, Character, Product, or Style. Choose Auto for automatic selection (default). This field is ignored when option is set to FluxKontextFinetune

lora_prefix
string (Lora Prefix)
Default: "MYLORA"

Prefix for the name of LoRA. Try to choose a unique string.

prompt
string (Prompt)

Prompt describing the relationship between the start and end images in given image pairs when FluxKontextFinetune is used. It is ignored with other options. For instance, if in the 'start' image is a blue car but the 'end' image is a red car the prompt can be 'turn the car red.'

webhook_url
string (Webhook Url)
Responses
200

Trigger word.

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/finetune
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Finetune Flux Pro/Dev

This endpoint will report the status of training LoRA models for Flux Pro. If completed, it will also return sample outputs for the LoRA.

SecurityAPIKeyHeader
Responses
200

Modified image url.

400

Bad Request

402

Insufficient Credit

422

Validation Error

get/finetune/{trigger_word}
Request samples
Response samples
application/json