Generate images from a text prompt, from reference images, or both. Use this in catalogs, creative tools, or any workflow that needs still images from TheFluxTrain.
URL: POST https://api.thefluxtrain.com/api/v1/image-generate/generate
Authentication: x-api-key (API keys)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | * | — | Text prompt (required if input_images omitted) |
input_images | string | * | — | Image URLs or data:image/...;base64,... URIs |
mask | string | No | — | Mask URL or data URI for inpainting |
model | string | No | flux-2-pro | See models below |
resolution | string | No | 2 MP | e.g. 1 MP, 2 MP |
aspect_ratio | string | No | 1:1 | e.g. 16:9, 9:16 |
steps | integer | No | 50 | Inference steps |
guidance | number | No | 60 | Guidance scale |
output_format | string | No | png | png or jpg |
output_quality | integer | No | 81 | 0–100 |
folder_id | string | No | — | Folder UUID to organize output in your account |
project_id | string | No | — | Optional project ID |
training_id | string | No | — | Optional training ID |
message_id | string | No | — | Your own tracking ID (echoed when supported) |
* At least one of prompt or input_images is required.
Models: flux-2-pro, nano-banana, nano-banana-2, flux-fill-pro, z-image-base, wan-2-7-pro, gpt-image-2
{
"prompt": "Product hero shot on marble surface",
"model": "flux-2-pro",
"resolution": "2 MP",
"aspect_ratio": "1:1",
"folder_id": "your-folder-uuid"
}
Wrapped in the standard response format.
data fields| Field | Type | Description |
|---|---|---|
id | string | Job ID — use with Jobs if status is PENDING |
url | string | Output image URL when status is SUCCESS |
status | string | e.g. SUCCESS, PENDING, FAILED |
media_type | string | IMAGE |
meta | object | Extra input/output details from the provider |
folder_id | string | null | Folder UUID if you sent one |
created_at | string | null | ISO 8601 timestamp |
provider | string | null | Upstream provider name |
provider_id | string | null | Provider’s job ID |
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://storage.example/output.png",
"status": "SUCCESS",
"media_type": "IMAGE",
"meta": {},
"folder_id": "your-folder-uuid",
"created_at": "2026-05-30T12:00:00Z"
},
"error": null
}
If status is PENDING, poll Jobs with id until complete.