Reframe
Reframe intelligently adjusts image aspect ratios using AI-powered content analysis. The model analyzes your image and automatically decides whether to expand (outpaint/zoom-out) or crop (zoom-in) to reach the target aspect ratio while preserving important content.
Lifecycle: Experimental · Released: August 14, 2025
Request body
Every call uses the universal POST /v1/run request body:
| Field | Type | Required | Description |
|---|---|---|---|
model_name | string | Yes | Must be reframe. |
inputs | object | Yes | Contains the endpoint-specific parameters documented under Input parameters. |
Place all endpoint parameters inside inputs; they are not top-level request fields.
Request
Reframe images by submitting the source image and target aspect ratio to the universal /v1/run endpoint:
Input parameters
imageRequiredimage URL | data URI
Source image to reframe to a new aspect ratio. The AI analyzes the image content and intelligently decides whether to expand or crop based on subject position, content density, and edge details.
aspect_ratioRequired'21:9' | '1:1' | '4:3' | '3:2' | '2:3' | '5:4' | '4:5' | '3:4' | '16:9' | '9:16'
Target aspect ratio for the reframed image. The AI determines whether expansion or cropping is more appropriate based on the current image content and dimensions.
resolution'1k' | '2k' | '4k'
Output resolution tier. '1k' produces ~1 megapixel output, '2k' ~4 megapixels, and '4k' ~16 megapixels. Exact output dimensions depend on this tier and the image aspect ratio.
Default: 1k
generation_mode'fast' | 'balanced' | 'quality'
Sets the generation quality level. 'quality' produces the most detailed and
realistic output but takes longer to process and costs more credits. 'fast'
prioritizes speed and lower cost. If omitted, FASHN selects generation_mode
automatically. For reframe, omitted generation_mode is currently billed as
'fast' at 1k and as 'balanced' at 2k or 4k.
num_imagesinteger
Number of images to generate in a single run. Image generation has a random element, so generating multiple images increases the chances of getting a good result.
Default: 1 · Range: 1 to 4
seedinteger
Sets random operations to a fixed state. Use the same seed to reproduce results with the same inputs, or different seed to force different results.
Default: 42 · Range: 0 to 2^32 - 1
output_format'png' | 'jpeg'
Specifies the output image format.
-png: Delivers the highest quality image, ideal for use cases such as content creation where quality is paramount.
-jpeg: Provides a faster response with a slightly compressed image, more
suitable for real-time applications.
Default: png
return_base64boolean
When set to true, the API will return the generated image as a base64-encoded string instead of a CDN URL. The base64 string will be prefixed according to the output_format (e.g., data:image/png;base64,... or data:image/jpeg;base64,...).
Privacy benefit: Outputs are available for up to 60 minutes instead of the standard three-day window. Request history contains only a <base64> placeholder.
Default: false
Technical limitations
| Requirement | Limit |
|---|---|
| Image file size | 30 MiB per image |
| Minimum dimensions | 15 × 15 px |
| Aspect ratio | 1:16 to 16:1 |
Inputs outside these limits fail with InputValidationError. The output resolution does not change the input limits.
Credit cost
generation_mode \ resolution | 1k | 2k | 4k |
|---|---|---|---|
fast | 1 | 2 | 3 |
balanced | 2 | 3 | 4 |
quality | 3 | 4 | 5 |
Additional pricing rules:
num_imagesmultiplies the total cost by the number of outputs requested.- If
generation_modeis omitted, automatic pricing applies.
Processing time
Processing time depends on both resolution and generation_mode. The fastest configuration (fast + 1k) typically completes in around 10 seconds, balanced at 2k finishes in around 25 seconds, and the most intensive combination (quality + 4k) typically takes around 55 seconds. Actual latency may vary with current server load.
Response polling
After submitting your request, poll the status endpoint using the returned prediction ID. See API Fundamentals for complete polling details.
Successful response
When your reframe operation completes successfully, the status endpoint will return:
The output array contains URLs to your reframed images, adjusted to the target aspect ratio.
Runtime errors
Reframe shares the common runtime errors in Error Handling.
In addition, Reframe may return:
| Error | Description |
|---|---|
InputValidationError | Image already matches target aspect ratio |
Related guides
For detailed implementation guidance and best practices:
- Image Preprocessing Best Practices - Optimize your source images for reframing operations