simpletuner/ideogram-4
Run simpletuner/ideogram-4 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. Matching .txt captions are used when present; missing captions get structured Ideogram JSON using trigger_word.
|
|
| 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.
|
| trigger_word |
string
|
TOK
|
Subject token used in generated JSON captions and validation prompts.
|
| caption_strategy |
None
|
textfile
|
Caption strategy for uploaded archives. textfile uses matching .txt captions and generated JSON fallbacks; filename derives captions from filenames; instanceprompt uses one structured JSON trigger prompt for every image.
|
| train_batch_size |
integer
|
1
Min: 1 Max: 2 |
Training batch size (1-2). Keep 1 unless the GPU has enough memory.
|
| learning_rate |
number
|
0.0001
Min: 0.0000001 Max: 0.01 |
LoRA learning rate.
|
| enable_regional_compile |
boolean
|
True
|
Enable torch.compile with regional compilation for the Ideogram transformer. Recommended for native FP8; disable only if compile causes a runtime issue.
|
| attention_mechanism |
None
|
kohaku-fa-auto
|
Attention backend.
|
| gradient_checkpointing_interval |
integer
|
Min: 1 |
Layers per checkpoint segment. Leave empty for the recipe default.
|
| gradient_checkpointing_segment_stride |
integer
|
Min: 1 |
Distance between checkpoint segments; must be at least the interval.
|
| dataloader_prefetch |
boolean
|
True
|
Prepare upcoming batches in the background.
|
| lora_rank |
integer
|
Min: 1 Max: 256 |
Adapter rank. Leave empty for rank 32 / alpha 4; an explicit rank sets alpha to match.
|
| lora_dropout |
number
|
0
Max: 0.5 |
Adapter dropout probability.
|
| seed |
integer
|
42
|
Training and validation seed.
|
| checkpoint_step_interval |
integer
|
0
|
Save every N optimizer updates; zero uses epoch-based saves only.
|
| validation_prompt |
string
|
Optional validation caption; plain text is wrapped as Ideogram JSON.
|
|
| hf_caption_column |
string
|
caption
|
Caption column for a Hugging Face dataset.
|
| hf_revision |
string
|
Optional dataset revision.
|
|
| hub_model_id |
string
|
Optional Hugging Face output repository (owner/name). Requires hf_token.
|
|
| push_checkpoints_to_hub |
boolean
|
True
|
Upload intermediate checkpoints as well as final weights.
|
| 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).
|
| s3_bucket |
string
|
|
S3-compatible bucket for publishing checkpoints.
|
| s3_region |
string
|
S3 region (optional).
|
|
| s3_endpoint_url |
string
|
Custom S3 endpoint URL (for non-AWS providers).
|
|
| s3_base_path |
string
|
Parent prefix inside the bucket. The job id is appended by the publisher (defaults to cog/ideogram4).
|
|
| 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",
"properties": {
"seed": {
"type": "integer",
"title": "Seed",
"default": 42,
"minimum": 0,
"x-order": 17,
"description": "Training and validation seed."
},
"hf_token": {
"type": "string",
"title": "Hf Token",
"format": "password",
"x-order": 35,
"nullable": true,
"writeOnly": true,
"description": "Hugging Face token for model or dataset access.",
"x-cog-secret": true
},
"lora_rank": {
"type": "integer",
"title": "Lora Rank",
"maximum": 256,
"minimum": 1,
"x-order": 15,
"nullable": true,
"description": "Adapter rank. Leave empty for rank 32 / alpha 4; an explicit rank sets alpha to match."
},
"s3_bucket": {
"type": "string",
"title": "S3 Bucket",
"default": "",
"x-order": 28,
"description": "S3-compatible bucket for publishing checkpoints."
},
"s3_region": {
"type": "string",
"title": "S3 Region",
"x-order": 29,
"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. Matching .txt captions are used when present; missing captions get structured Ideogram JSON using trigger_word."
},
"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."
},
"hf_revision": {
"type": "string",
"title": "Hf Revision",
"x-order": 21,
"nullable": true,
"description": "Optional dataset revision."
},
"return_logs": {
"type": "boolean",
"title": "Return Logs",
"default": true,
"x-order": 36,
"description": "Print the tail of debug.log."
},
"hub_model_id": {
"type": "string",
"title": "Hub Model Id",
"x-order": 22,
"nullable": true,
"description": "Optional Hugging Face output repository (owner/name). Requires hf_token."
},
"lora_dropout": {
"type": "number",
"title": "Lora Dropout",
"default": 0,
"maximum": 0.5,
"minimum": 0,
"x-order": 16,
"description": "Adapter dropout probability."
},
"s3_base_path": {
"type": "string",
"title": "S3 Base Path",
"x-order": 31,
"nullable": true,
"description": "Parent prefix inside the bucket. The job id is appended by the publisher (defaults to cog/ideogram4)."
},
"trigger_word": {
"type": "string",
"title": "Trigger Word",
"default": "TOK",
"x-order": 6,
"description": "Subject token used in generated JSON captions and validation prompts."
},
"learning_rate": {
"type": "number",
"title": "Learning Rate",
"default": 0.0001,
"maximum": 0.01,
"minimum": 1e-07,
"x-order": 9,
"description": "LoRA learning rate."
},
"s3_access_key": {
"type": "string",
"title": "S3 Access Key",
"format": "password",
"x-order": 33,
"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": 34,
"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": 27,
"description": "Optional max train steps override (0 disables the step limit)."
},
"s3_endpoint_url": {
"type": "string",
"title": "S3 Endpoint Url",
"x-order": 30,
"nullable": true,
"description": "Custom S3 endpoint URL (for non-AWS providers)."
},
"caption_strategy": {
"enum": [
"textfile",
"filename",
"instanceprompt"
],
"type": "string",
"title": "caption_strategy",
"description": "Caption strategy for uploaded archives. textfile uses matching .txt captions and generated JSON fallbacks; filename derives captions from filenames; instanceprompt uses one structured JSON trigger prompt for every image.",
"default": "textfile",
"x-order": 7
},
"num_train_epochs": {
"type": "integer",
"title": "Num Train Epochs",
"default": 25,
"minimum": 1,
"x-order": 26,
"description": "Total training epochs."
},
"train_batch_size": {
"type": "integer",
"title": "Train Batch Size",
"default": 1,
"maximum": 2,
"minimum": 1,
"x-order": 8,
"description": "Training batch size (1-2). Keep 1 unless the GPU has enough memory."
},
"hf_caption_column": {
"type": "string",
"title": "Hf Caption Column",
"default": "caption",
"x-order": 20,
"description": "Caption column for a Hugging Face dataset."
},
"validation_prompt": {
"type": "string",
"title": "Validation Prompt",
"x-order": 19,
"nullable": true,
"description": "Optional validation caption; plain text is wrapped as Ideogram JSON."
},
"s3_public_base_url": {
"type": "string",
"title": "S3 Public Base Url",
"x-order": 32,
"nullable": true,
"description": "Public base URL to build shareable links (optional)."
},
"attention_mechanism": {
"enum": [
"kohaku-fa-auto",
"diffusers"
],
"type": "string",
"title": "attention_mechanism",
"description": "Attention backend.",
"default": "kohaku-fa-auto",
"x-order": 11
},
"dataloader_prefetch": {
"type": "boolean",
"title": "Dataloader Prefetch",
"default": true,
"x-order": 14,
"description": "Prepare upcoming batches in the background."
},
"checkpoints_total_limit": {
"type": "integer",
"title": "Checkpoints Total Limit",
"default": 3,
"maximum": 5,
"minimum": 1,
"x-order": 24,
"description": "Maximum checkpoints to retain (max 5)."
},
"enable_regional_compile": {
"type": "boolean",
"title": "Enable Regional Compile",
"default": true,
"x-order": 10,
"description": "Enable torch.compile with regional compilation for the Ideogram transformer. Recommended for native FP8; disable only if compile causes a runtime issue."
},
"push_checkpoints_to_hub": {
"type": "boolean",
"title": "Push Checkpoints To Hub",
"default": true,
"x-order": 23,
"description": "Upload intermediate checkpoints as well as final weights."
},
"checkpoint_step_interval": {
"type": "integer",
"title": "Checkpoint Step Interval",
"default": 0,
"minimum": 0,
"x-order": 18,
"description": "Save every N optimizer updates; zero uses epoch-based saves only."
},
"checkpoint_epoch_interval": {
"type": "integer",
"title": "Checkpoint Epoch Interval",
"default": 5,
"minimum": 1,
"x-order": 25,
"description": "Write a checkpoint every N epochs."
},
"gradient_checkpointing_interval": {
"type": "integer",
"title": "Gradient Checkpointing Interval",
"minimum": 1,
"x-order": 12,
"nullable": true,
"description": "Layers per checkpoint segment. Leave empty for the recipe default."
},
"gradient_checkpointing_segment_stride": {
"type": "integer",
"title": "Gradient Checkpointing Segment Stride",
"minimum": 1,
"x-order": 13,
"nullable": true,
"description": "Distance between checkpoint segments; must be at least the interval."
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "string",
"title": "Output",
"format": "uri"
}