Skip to main content
FLUX.2 [flex] is a highly configurable text-to-image generation model from Black Forest Labs, available through AnyFast. It offers fine-grained control over inference steps and guidance scale for design experts. The API is synchronous — it returns the generated image directly as base64-encoded data.

Key capabilities

  • Text-to-image — Generate images from text descriptions
  • Inference steps control — Adjust sampling steps (1–50) for speed vs. fidelity tradeoff
  • Guidance scale — Fine-tune prompt adherence (1.5–10)
  • High resolution — Supports up to 4MP output resolution
  • Reproducible — Use seed for deterministic generation

Quick example

curl https://www.anyfast.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2-flex",
    "prompt": "A cute baby polar bear",
    "size": "1024x1024",
    "inference_steps": 30,
    "guidance_scale": 7.5
  }'

Parameters

ParameterTypeRequiredDescription
modelstringYesMust be flux-2-flex
promptstringYesText description of the image
nintegerNoNumber of images (1–4). Default: 1
sizestringNoOutput size, e.g. 1024x1024. Supports up to 4MP
inference_stepsintegerNoSampling steps (1–50). Low (6–20) for fast prototyping, high (40–50) for max fidelity
guidance_scalenumberNoGuidance scale (1.5–10). Higher = more prompt-faithful
output_formatstringNojpeg or png
seedintegerNoRandom seed for reproducibility

Response

FieldDescription
data[].b64_jsonBase64-encoded image data
createdUnix timestamp

API Reference

View the interactive API playground for FLUX.2 [flex].