Skip to main content

Black Forest Labs FLUX.2 [flex]

Flexible, professional-grade image generation with fine-grained control over guidance, steps, and a wide resolution range for large-format output.
FLUX.2 Flex is a text-to-image API that generates professional-grade images with fine-grained control. Developed by Black Forest Labs, it offers adjustable guidance and inference steps plus a wide resolution range from 256 to 1920 pixels per side for large-format output. It also accepts up to 4 optional input images for image-to-image generation and editing, and produces PNG or JPEG output.

Key capabilities

  • Custom resolution: Set exact width and height from 256 to 1920 pixels per side
  • Fine-grained control: Adjustable guidance scale (1.5-10) and inference steps (1-50) for quality tuning
  • Image-to-image: Provide up to 4 reference images (input_image, input_image_2, input_image_3, input_image_4) for editing and style transfer
  • Prompt upsampling: Optional automatic prompt enhancement for more creative outputs
  • Safety control: Adjustable moderation tolerance from 0 (most strict) to 5 (least strict)
  • Seed control: Optional seed (0 to 4,294,967,295) that influences generation
  • Output formats: PNG (lossless) or JPEG (compressed)
  • Async processing: Webhook notifications or polling for task completion

Use cases

  • Marketing and advertising: Generate product visuals and campaign imagery from descriptions
  • Large-format output: Produce high-resolution images for print and display up to 1920px per side
  • Content creation: Create unique illustrations and graphics for blogs, social media, and websites
  • Image editing: Refine and restyle existing images using up to 4 reference inputs
  • E-commerce: Generate product mockups and lifestyle imagery at scale

Generate images with FLUX.2 Flex

Create images by submitting a request to the API. The service returns a task ID for async polling or webhook notification.

POST /v1/ai/text-to-image/flux-2-flex

Create a new image generation task

GET /v1/ai/text-to-image/flux-2-flex

List all FLUX.2 Flex tasks with status

GET /v1/ai/text-to-image/flux-2-flex/{task-id}

Get task status and results by ID

Parameters

width and height are floored to the nearest multiple of 16 by the provider. For example, 300x500 is generated as 288x496. Choose multiples of 16 for exact dimensions.
Generated image URLs are signed and expire quickly (around 10-15 minutes). Download or store the output promptly; do not treat the URL as a permanent link.

Frequently Asked Questions

FLUX.2 Flex is a professional-grade text-to-image model by Black Forest Labs with fine-grained control over resolution, guidance, and steps. You submit a text prompt via the API, optionally include up to 4 reference images, receive a task ID immediately, then poll for results or receive a webhook notification when processing completes.
FLUX.2 Flex uses explicit width and height parameters, each accepting 256 to 1920 pixels. The default is 1024×768. Common sizes include 1024×1024 (square), 1920×1080 (16:9 landscape), and 1080×1920 (9:16 portrait). Higher total resolution increases generation cost.
You can provide up to 4 Base64-encoded reference images using input_image, input_image_2, input_image_3, and input_image_4. The model uses these for image-to-image generation, editing, and style transfer while still following your text prompt. Supported input formats are JPEG, PNG, and WebP.
The guidance parameter (1.5-10, default 3.0) controls how closely the model follows your prompt; higher values produce images more faithful to the description. The steps parameter (1-50, default 50) controls quality: more steps produce finer detail but take longer to process.
The seed influences generation and helps you steer toward similar results, but identical output for an identical seed is not guaranteed. Setting prompt_upsampling to true makes runs inherently non-reproducible, since the prompt is rewritten on each call.
FLUX.2 Flex offers fine-grained control with custom resolution up to 1920px per side, ideal for large-format and professional output. FLUX.2 Klein is optimized for speed with sub-second generation. Choose FLUX.2 Flex when control and resolution matter; choose FLUX.2 Klein when speed is critical.
See Rate Limits for current limits by subscription tier.
See Pricing for detailed rates and subscription options.

Best practices

  • Prompt writing: Be specific about subjects, scenes, lighting, atmosphere, and art style for better results
  • Resolution choice: Set width and height for your target format; higher resolution increases cost
  • Guidance tuning: Start with the default guidance (3.0) and increase for more literal prompt adherence
  • Reference images: Use high-quality inputs when doing image-to-image or style transfer
  • Production integration: Use webhooks instead of polling for scalable applications
  • Error handling: Implement retry logic with exponential backoff for 503 errors
  • FLUX.2 Klein: Fastest FLUX.2 model for sub-second generation
  • FLUX.2 Pro: High-quality generation for premium results
  • Flux Kontext Max: Context-aware image editing with maximum prompt adherence