ApiframeApiframe Docs
Image GenerationFlux

Flux 2 Pro

High-quality image generation and editing with multi-reference support.

Use in Apiframe Studio

POST /v2/images/generatemodel: "flux-2-pro"

High-quality image generation and editing with support for up to 8 reference images. Excellent at text rendering, photorealism, and maintaining character consistency across generations.

See Image Generation overview for common request fields, response format, and error codes.

Model-specific parameters

ParameterTypeDescription
fluxParams.aspect_ratiostringAspect ratio in "W:H" format. Use "match_input_image" to match the first input image
fluxParams.output_formatstringOutput format: "jpg", "png", or "webp"
fluxParams.output_qualityintegerOutput quality (0–100). Not relevant for PNG
fluxParams.seedintegerRandom seed for reproducible generation
fluxParams.widthintegerWidth (256–2048). Only used when aspect_ratio is custom
fluxParams.heightintegerHeight (256–2048). Only used when aspect_ratio is custom
fluxParams.resolutionstringResolution in megapixels (e.g. "1 MP", "2 MP"). Up to 4 MP
fluxParams.input_imagesstring[]Up to 8 reference image URLs for image-to-image / multi-reference editing
fluxParams.prompt_upsamplingbooleanAutomatically modify the prompt for more creative results

Code examples

Text-to-image

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a sleek silver sports car racing along a coastal highway at sunset, hyper-realistic",
    "model": "flux-2-pro",
    "fluxParams": {
      "aspect_ratio": "16:9",
      "output_format": "jpg",
      "output_quality": 90
    }
  }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/images/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a sleek silver sports car racing along a coastal highway at sunset, hyper-realistic",
        "model": "flux-2-pro",
        "fluxParams": {
            "aspect_ratio": "16:9",
            "output_format": "jpg",
            "output_quality": 90,
        },
    },
)
print(response.json())
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "a sleek silver sports car racing along a coastal highway at sunset, hyper-realistic",
    model: "flux-2-pro",
    fluxParams: { aspect_ratio: "16:9", output_format: "jpg", output_quality: 90 },
  }),
});
console.log(await response.json());

Image editing with references

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "change the car to blue",
    "model": "flux-2-pro",
    "fluxParams": {
      "aspect_ratio": "match_input_image",
      "input_images": ["https://example.com/car.jpg"],
      "output_format": "jpg"
    }
  }'

Try it

POST/v2/images/generateTry it

On this page