TheFluxTrain

Image generation

Text-to-image and image-to-image with Flux and other models.

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)

Request body

FieldTypeRequiredDefaultDescription
promptstring*Text prompt (required if input_images omitted)
input_imagesstring*Image URLs or data:image/...;base64,... URIs
maskstringNoMask URL or data URI for inpainting
modelstringNoflux-2-proSee models below
resolutionstringNo2 MPe.g. 1 MP, 2 MP
aspect_ratiostringNo1:1e.g. 16:9, 9:16
stepsintegerNo50Inference steps
guidancenumberNo60Guidance scale
output_formatstringNopngpng or jpg
output_qualityintegerNo810–100
folder_idstringNoFolder UUID to organize output in your account
project_idstringNoOptional project ID
training_idstringNoOptional training ID
message_idstringNoYour 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

Example

{
  "prompt": "Product hero shot on marble surface",
  "model": "flux-2-pro",
  "resolution": "2 MP",
  "aspect_ratio": "1:1",
  "folder_id": "your-folder-uuid"
}

Response

Wrapped in the standard response format.

data fields

FieldTypeDescription
idstringJob ID — use with Jobs if status is PENDING
urlstringOutput image URL when status is SUCCESS
statusstringe.g. SUCCESS, PENDING, FAILED
media_typestringIMAGE
metaobjectExtra input/output details from the provider
folder_idstring | nullFolder UUID if you sent one
created_atstring | nullISO 8601 timestamp
providerstring | nullUpstream provider name
provider_idstring | nullProvider’s job ID

Example

{
  "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.