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.
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image | string | Yes | - | Base64-encoded image to expand |
prompt | string | No | - | Text description to guide the expanded areas (e.g., “sunset sky”, “forest background”) |
left | integer | No | 0 | Pixels to expand on the left edge (0-2048) |
right | integer | No | 0 | Pixels to expand on the right edge (0-2048) |
top | integer | No | 0 | Pixels to expand on the top edge (0-2048) |
bottom | integer | No | 0 | Pixels to expand on the bottom edge (0-2048) |
webhook_url | string | No | - | URL for task completion notification |
Frequently Asked Questions
What is Flux Pro Image Expand and how does it work?
What is Flux Pro Image Expand and how does it work?
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.
How much can I expand an image?
How much can I expand an 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.What image formats are supported?
What image formats are supported?
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.
How does the prompt parameter work?
How does the prompt parameter work?
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.Will the expanded areas match my original image?
Will the expanded areas match my original image?
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.
What are the rate limits for Image Expand?
What are the rate limits for Image Expand?
Rate limits vary by subscription tier. See Rate Limits for current limits.
How much does Image Expand cost?
How much does Image Expand cost?
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
Related APIs
- Flux 2 Pro: Generate images from text descriptions
- Flux Kontext Pro: Text-to-image with context understanding and image guidance
- Image Upscaler: Enhance image resolution and quality
- Remove Background: Remove image backgrounds for compositing