Skip to main content

Flux Pro integration

Powered by Flux Pro, this API expands images beyond their original boundaries using AI-generated content that seamlessly blends with the original.
Flux Pro Image Expand is an AI-powered outpainting API that extends images beyond their original boundaries. Specify how many pixels to add on each side (left, right, top, bottom) up to 2048 pixels, and optionally provide a text prompt to guide the generated content. The API produces seamless expansions that maintain visual consistency with the original image, making it ideal for adapting images to different aspect ratios or adding creative space around subjects.

Key capabilities

  • Directional expansion: Independently control expansion on each edge (left, right, top, bottom) from 0 to 2048 pixels
  • Prompt-guided generation: Optional text descriptions to guide what appears in expanded areas
  • Seamless blending: AI-generated content matches the style, lighting, and composition of the original image
  • Flexible input: Accept base64-encoded images for easy integration
  • High-resolution output: Support for substantial canvas extensions while maintaining quality
  • Async processing: Webhook notifications or polling for task completion

Use cases

  • Social media adaptation: Convert landscape images to portrait format (or vice versa) for different platforms
  • Print production: Add bleed area or extend backgrounds for large-format printing
  • Design workflows: Create additional canvas space for text overlays, logos, or design elements
  • Photography enhancement: Extend cropped photos to recover lost composition
  • E-commerce: Expand product images to fit standardized dimensions
  • Marketing materials: Adapt hero images to various banner sizes and aspect ratios

Expand images with Flux Pro

Submit an image with expansion parameters to extend it in any direction. The service returns a task ID for async polling or webhook notification.

Parameters

ParameterTypeRequiredDefaultDescription
imagestringYes-Base64-encoded image to expand
promptstringNo-Text description to guide the expanded areas (e.g., “sunset sky”, “forest background”)
leftintegerNo0Pixels to expand on the left edge (0-2048)
rightintegerNo0Pixels to expand on the right edge (0-2048)
topintegerNo0Pixels to expand on the top edge (0-2048)
bottomintegerNo0Pixels to expand on the bottom edge (0-2048)
webhook_urlstringNo-URL for task completion notification

Frequently Asked Questions

Flux Pro Image Expand is an AI-powered outpainting API that extends images beyond their original boundaries. You submit a base64-encoded image with expansion values for each edge (left, right, top, bottom), receive a task ID immediately, then poll for results or receive a webhook notification. The API generates new content that seamlessly blends with the original image.
You can expand up to 2048 pixels on each edge (left, right, top, bottom) independently. Set any edge to 0 if you do not want to expand in that direction. For example, to only extend the width, set left and right values while keeping top and bottom at 0.
The API accepts base64-encoded images. Common formats like JPEG, PNG, and WebP can be encoded and submitted. The output is returned as a downloadable image URL.
The optional prompt parameter guides what the AI generates in the expanded areas. For example, “blue sky with clouds” will generate sky content, while “brick wall” will generate a wall background. If omitted, the AI infers appropriate content from the existing image context.
Yes, Flux Pro analyzes your image’s style, lighting, color palette, and composition to generate expansions that blend seamlessly. The AI maintains visual consistency so the final image appears natural and cohesive.
Rate limits vary by subscription tier. See Rate Limits for current limits.
See the Pricing page for current rates and subscription options.

Best practices

  • Balanced expansion: For best results, avoid extreme asymmetric expansions; gradual extensions maintain better visual coherence
  • Prompt specificity: Use descriptive prompts when you need specific content in expanded areas (e.g., “ocean waves” instead of just “water”)
  • Image quality: Higher resolution input images produce better expansion results
  • Edge content: Ensure the edges of your original image have enough context for the AI to continue naturally
  • Production integration: Use webhooks instead of polling for scalable applications
  • Error handling: Implement retry logic with exponential backoff for 503 errors