Skip to content

Flux-2 - Pro Text to Image ​

Endpoint ​

POST /images/generations

Full URL: https://modelfold.ai/v1/images/generations

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.

Input parameters for the generation task

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name to use for generation. Required field.
- Must be flux-2/pro-text-to-image for this endpoint Default:"flux-2/pro-text-to-image"。 Allowed values:flux-2/pro-text-to-image。 Example:flux-2/pro-text-to-image。
promptstringYesPrompt required by the ModelFold gateway; at most 2000 characters. Must be between 3 and 5000 characters. (Max length: 5000 characters) maxLength: 2000. Example:Hyperrealistic supermarket blister pack on clean olive green surface. No shadows. Inside: bright pink 3D letters spelling "FLUX.2" pressing against stretched plastic film, creating realistic deformation and reflective highlights. Bottom left corner: barcode sticker with text "GENERATE NOW" and "PLAYGROUND". Plastic shows tension wrinkles and realistic shine where stretched by the volumetric letters.。
aspect_ratiostringYesRequired. Aspect ratio for the generated image. Allowed values:1:1 / 4:3 / 3:4 / 16:9 / 9:16 / 3:2 / 2:3。 Example:1:1。
resolutionstringYesRequired. Output image resolution. Allowed values:1K / 2K。 Example:1K。
nsfw_checkerbooleanNoDefaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request Example ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "flux-2/pro-text-to-image",
  "prompt": "Hyperrealistic supermarket blister pack on clean olive green surface. No shadows. Inside: bright pink 3D letters spelling \"FLUX.2\" pressing against stretched plastic film, creating realistic deformation and reflective highlights. Bottom left corner: barcode sticker with text \"GENERATE NOW\" and \"PLAYGROUND\". Plastic shows tension wrinkles and realistic shine where stretched by the volumetric letters.",
  "aspect_ratio": "1:1",
  "resolution": "1K"
}'
json
{
  "model": "flux-2/pro-text-to-image",
  "prompt": "Hyperrealistic supermarket blister pack on clean olive green surface. No shadows. Inside: bright pink 3D letters spelling \"FLUX.2\" pressing against stretched plastic film, creating realistic deformation and reflective highlights. Bottom left corner: barcode sticker with text \"GENERATE NOW\" and \"PLAYGROUND\". Plastic shows tension wrinkles and realistic shine where stretched by the volumetric letters.",
  "aspect_ratio": "1:1",
  "resolution": "1K"
}

Response ​

200 — Generation completed. usage contains actual billing details; result URLs are illustrative. ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

ModelFold — one API for all the best AI models.