simpletuner/flux2
Run simpletuner/flux2 with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
| Field | Type | Default value | Description |
|---|---|---|---|
| train_data |
string
|
Zip or tar of training images with matching .txt captions.
|
|
| hf_dataset |
string
|
Hugging Face dataset repo ID to use when no archive is provided (e.g., user/dataset).
|
|
| pixel_area |
integer
|
1024
Min: 256 Max: 2048 |
Pixel-area resolution; also applied to min/max/target size and validation resolution.
|
| enable_crop |
boolean
|
True
|
Enable cropping when preparing samples.
|
| crop_style |
None
|
center
|
Crop location style when cropping is enabled.
|
| crop_aspect |
None
|
square
|
Aspect handling for crops: square (1:1) or preserve source aspect.
|
| train_batch_size |
integer
|
2
Min: 1 Max: 4 |
Training batch size (1-4).
|
| checkpoints_total_limit |
integer
|
3
Min: 1 Max: 5 |
Maximum checkpoints to retain (max 5).
|
| checkpoint_epoch_interval |
integer
|
5
Min: 1 |
Write a checkpoint every N epochs.
|
| num_train_epochs |
integer
|
25
Min: 1 |
Total training epochs.
|
| max_train_steps |
integer
|
0
|
Optional max train steps override (0 disables the step limit).
|
| learning_rate |
number
|
Learning rate override (default uses config value).
|
|
| s3_bucket |
string
|
S3-compatible bucket for publishing checkpoints (required).
|
|
| s3_region |
string
|
S3 region (optional).
|
|
| s3_endpoint_url |
string
|
Custom S3 endpoint URL (for non-AWS providers).
|
|
| s3_base_path |
string
|
Prefix inside the bucket (defaults to cog/flux2/{job_id}).
|
|
| s3_public_base_url |
string
|
Public base URL to build shareable links (optional).
|
|
| s3_access_key |
string
|
S3 access key (leave blank to use IAM/instance roles).
|
|
| s3_secret_key |
string
|
S3 secret key (leave blank to use IAM/instance roles).
|
|
| hf_token |
string
|
Hugging Face token for model or dataset access.
|
|
| return_logs |
boolean
|
True
|
Print the tail of debug.log.
|
{
"type": "object",
"title": "Input",
"required": [
"s3_bucket"
],
"properties": {
"hf_token": {
"type": "string",
"title": "Hf Token",
"format": "password",
"x-order": 19,
"nullable": true,
"writeOnly": true,
"description": "Hugging Face token for model or dataset access.",
"x-cog-secret": true
},
"s3_bucket": {
"type": "string",
"title": "S3 Bucket",
"x-order": 12,
"description": "S3-compatible bucket for publishing checkpoints (required)."
},
"s3_region": {
"type": "string",
"title": "S3 Region",
"x-order": 13,
"nullable": true,
"description": "S3 region (optional)."
},
"crop_style": {
"enum": [
"center",
"random"
],
"type": "string",
"title": "crop_style",
"description": "Crop location style when cropping is enabled.",
"default": "center",
"x-order": 4
},
"hf_dataset": {
"type": "string",
"title": "Hf Dataset",
"x-order": 1,
"nullable": true,
"description": "Hugging Face dataset repo ID to use when no archive is provided (e.g., user/dataset)."
},
"pixel_area": {
"type": "integer",
"title": "Pixel Area",
"default": 1024,
"maximum": 2048,
"minimum": 256,
"x-order": 2,
"description": "Pixel-area resolution; also applied to min/max/target size and validation resolution."
},
"train_data": {
"type": "string",
"title": "Train Data",
"format": "uri",
"x-order": 0,
"nullable": true,
"description": "Zip or tar of training images with matching .txt captions."
},
"crop_aspect": {
"enum": [
"square",
"preserve"
],
"type": "string",
"title": "crop_aspect",
"description": "Aspect handling for crops: square (1:1) or preserve source aspect.",
"default": "square",
"x-order": 5
},
"enable_crop": {
"type": "boolean",
"title": "Enable Crop",
"default": true,
"x-order": 3,
"description": "Enable cropping when preparing samples."
},
"return_logs": {
"type": "boolean",
"title": "Return Logs",
"default": true,
"x-order": 20,
"description": "Print the tail of debug.log."
},
"s3_base_path": {
"type": "string",
"title": "S3 Base Path",
"x-order": 15,
"nullable": true,
"description": "Prefix inside the bucket (defaults to cog/flux2/{job_id})."
},
"learning_rate": {
"type": "number",
"title": "Learning Rate",
"x-order": 11,
"nullable": true,
"description": "Learning rate override (default uses config value)."
},
"s3_access_key": {
"type": "string",
"title": "S3 Access Key",
"format": "password",
"x-order": 17,
"nullable": true,
"writeOnly": true,
"description": "S3 access key (leave blank to use IAM/instance roles).",
"x-cog-secret": true
},
"s3_secret_key": {
"type": "string",
"title": "S3 Secret Key",
"format": "password",
"x-order": 18,
"nullable": true,
"writeOnly": true,
"description": "S3 secret key (leave blank to use IAM/instance roles).",
"x-cog-secret": true
},
"max_train_steps": {
"type": "integer",
"title": "Max Train Steps",
"default": 0,
"minimum": 0,
"x-order": 10,
"description": "Optional max train steps override (0 disables the step limit)."
},
"s3_endpoint_url": {
"type": "string",
"title": "S3 Endpoint Url",
"x-order": 14,
"nullable": true,
"description": "Custom S3 endpoint URL (for non-AWS providers)."
},
"num_train_epochs": {
"type": "integer",
"title": "Num Train Epochs",
"default": 25,
"minimum": 1,
"x-order": 9,
"description": "Total training epochs."
},
"train_batch_size": {
"type": "integer",
"title": "Train Batch Size",
"default": 2,
"maximum": 4,
"minimum": 1,
"x-order": 6,
"description": "Training batch size (1-4)."
},
"s3_public_base_url": {
"type": "string",
"title": "S3 Public Base Url",
"x-order": 16,
"nullable": true,
"description": "Public base URL to build shareable links (optional)."
},
"checkpoints_total_limit": {
"type": "integer",
"title": "Checkpoints Total Limit",
"default": 3,
"maximum": 5,
"minimum": 1,
"x-order": 7,
"description": "Maximum checkpoints to retain (max 5)."
},
"checkpoint_epoch_interval": {
"type": "integer",
"title": "Checkpoint Epoch Interval",
"default": 5,
"minimum": 1,
"x-order": 8,
"description": "Write a checkpoint every N epochs."
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "string",
"title": "Output"
}