{"openapi":"3.1.0","info":{"title":"Smart Resize","version":"1.0.0","description":"Smart image resize to arbitrary dimensions, powered by Nano Banana Pro with vision-LLM-guided prompting for composition-aware recomposition. Crop, cropping, resize ads."},"paths":{"/mixio/smart-resize":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"SmartResizeInput","required":["image_url","target_sizes"],"properties":{"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Optional random seed forwarded to the inner nano-banana-pro /edit calls for reproducibility. The same seed is used for every target size when set."},"prompt":{"type":"string","title":"Prompt","default":"","examples":[""],"maxLength":5000,"description":"Optional extra instruction that is forwarded to nano-banana-pro alongside the auto-generated resize prompt. Leave empty to let the model preserve the original image content as closely as possible."},"image_url":{"type":"string","title":"Image URL","examples":["https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"],"description":"The URL of the source image to resize."},"sync_mode":{"type":"boolean","title":"Sync Mode","default":false,"description":"When True, the response contains data URIs in place of CDN URLs so the client can decode the images without an extra HTTP request. Adds latency for large outputs."},"resolution":{"enum":["1K","2K","4K"],"type":"string","title":"Resolution","default":"1K","description":"Hint for the minimum resolution tier to use internally. The smart-resize algorithm may pick a higher tier automatically when the requested target size is too large for this tier. This field does not affect the final output dimensions — those come from ``target_sizes``."},"target_sizes":{"type":"array","items":{"type":"string"},"title":"Target Sizes","examples":[["1024x1024","1920x1080","768x1344"]],"maxItems":10,"minItems":1,"description":"The list of target dimensions to generate, each written as ``<width>x<height>`` (e.g. ``\"1920x1080\"``). One output image is produced per target size (multiplied by ``num_images_per_size``). The endpoint internally picks the smallest nano-banana-pro preset that fully covers each target so the final image is a pixel-perfect match with no upscaling."},"output_format":{"enum":["jpeg","png","webp"],"type":"string","title":"Output Format","default":"png","description":"The output image format."},"safety_tolerance":{"enum":["1","2","3","4","5","6"],"type":"string","title":"Safety Tolerance","default":"4","description":"The safety tolerance level applied to the inner nano-banana-pro /edit calls. Higher numbers loosen safety filtering."},"num_images_per_size":{"type":"integer","title":"Num Images Per Size","default":1,"maximum":4,"minimum":1,"description":"The number of nano-banana-pro variants to produce for each target size. The response images list will contain ``len(target_sizes) * num_images_per_size`` images in total."}},"x-fal-order-properties":["image_url","target_sizes","prompt","num_images_per_size","resolution","output_format","safety_tolerance","seed","sync_mode"]}}}}}},"/mixio/smart-resize/requests/{request_id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","title":"SmartResizeOutput","required":["images","description","results"],"properties":{"images":{"type":"array","items":{"$ref":"#/components/schemas/ImageFile"},"title":"Images","examples":[[{"url":"https://storage.googleapis.com/falserverless/example_outputs/nano-banana-pro-edit-output.png","file_name":"nano-banana-pro-edit-output.png","content_type":"image/png"}]],"description":"All generated images, flattened across every target size. Order matches the order of ``results`` below: the first ``num_images_per_size`` entries correspond to ``target_sizes[0]`` and so on."},"results":{"type":"array","items":{"$ref":"#/components/schemas/SmartResizeResult"},"title":"Results","description":"Per-target-size breakdown with the requested width/height and the nano-banana-pro (aspect_ratio, resolution) preset that was used internally."},"description":{"type":"string","title":"Description","description":"The description of the generated images."}},"x-fal-order-properties":["images","description","results"]}}}}}}},"/mixio/smart-resize/requests/{request_id}/status":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","required":["status","request_id"],"properties":{"logs":{"type":"object","description":"The logs.","additionalProperties":true},"status":{"enum":["IN_QUEUE","IN_PROGRESS","COMPLETED"],"type":"string"},"metrics":{"type":"object","description":"The metrics.","additionalProperties":true},"cancel_url":{"type":"string","description":"The cancel url."},"request_id":{"type":"string","description":"The request id."},"status_url":{"type":"string","description":"The status url."},"response_url":{"type":"string","description":"The response url."},"queue_position":{"type":"integer","description":"The queue position."}}}}}}}}},"/mixio/smart-resize/requests/{request_id}/cancel":{"put":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the request was cancelled successfully."}}}}}}}}}},"components":{"schemas":{"ImageFile":{"type":"object","title":"ImageFile","required":["url"],"properties":{"url":{"type":"string","title":"Url","description":"The URL where the file can be downloaded from."},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width","description":"The width of the image"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height","description":"The height of the image"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","examples":["z9RV14K95DvU.png"],"description":"The name of the file. It will be auto-generated if not provided."},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size","examples":[4404019],"description":"The size of the file in bytes."},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","examples":["image/png"],"description":"The mime type of the file."}},"x-fal-order-properties":["url","content_type","file_name","file_size","width","height"]},"QueueStatus":{"type":"object","required":["status","request_id"],"properties":{"logs":{"type":"object","description":"The logs.","additionalProperties":true},"status":{"enum":["IN_QUEUE","IN_PROGRESS","COMPLETED"],"type":"string"},"metrics":{"type":"object","description":"The metrics.","additionalProperties":true},"cancel_url":{"type":"string","description":"The cancel url."},"request_id":{"type":"string","description":"The request id."},"status_url":{"type":"string","description":"The status url."},"response_url":{"type":"string","description":"The response url."},"queue_position":{"type":"integer","description":"The queue position."}}},"SmartResizeInput":{"type":"object","title":"SmartResizeInput","required":["image_url","target_sizes"],"properties":{"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Optional random seed forwarded to the inner nano-banana-pro /edit calls for reproducibility. The same seed is used for every target size when set."},"prompt":{"type":"string","title":"Prompt","default":"","examples":[""],"maxLength":5000,"description":"Optional extra instruction that is forwarded to nano-banana-pro alongside the auto-generated resize prompt. Leave empty to let the model preserve the original image content as closely as possible."},"image_url":{"type":"string","title":"Image URL","examples":["https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"],"description":"The URL of the source image to resize."},"sync_mode":{"type":"boolean","title":"Sync Mode","default":false,"description":"When True, the response contains data URIs in place of CDN URLs so the client can decode the images without an extra HTTP request. Adds latency for large outputs."},"resolution":{"enum":["1K","2K","4K"],"type":"string","title":"Resolution","default":"1K","description":"Hint for the minimum resolution tier to use internally. The smart-resize algorithm may pick a higher tier automatically when the requested target size is too large for this tier. This field does not affect the final output dimensions — those come from ``target_sizes``."},"target_sizes":{"type":"array","items":{"type":"string"},"title":"Target Sizes","examples":[["1024x1024","1920x1080","768x1344"]],"maxItems":10,"minItems":1,"description":"The list of target dimensions to generate, each written as ``<width>x<height>`` (e.g. ``\"1920x1080\"``). One output image is produced per target size (multiplied by ``num_images_per_size``). The endpoint internally picks the smallest nano-banana-pro preset that fully covers each target so the final image is a pixel-perfect match with no upscaling."},"output_format":{"enum":["jpeg","png","webp"],"type":"string","title":"Output Format","default":"png","description":"The output image format."},"safety_tolerance":{"enum":["1","2","3","4","5","6"],"type":"string","title":"Safety Tolerance","default":"4","description":"The safety tolerance level applied to the inner nano-banana-pro /edit calls. Higher numbers loosen safety filtering."},"num_images_per_size":{"type":"integer","title":"Num Images Per Size","default":1,"maximum":4,"minimum":1,"description":"The number of nano-banana-pro variants to produce for each target size. The response images list will contain ``len(target_sizes) * num_images_per_size`` images in total."}},"x-fal-order-properties":["image_url","target_sizes","prompt","num_images_per_size","resolution","output_format","safety_tolerance","seed","sync_mode"]},"SmartResizeOutput":{"type":"object","title":"SmartResizeOutput","required":["images","description","results"],"properties":{"images":{"type":"array","items":{"$ref":"#/components/schemas/ImageFile"},"title":"Images","examples":[[{"url":"https://storage.googleapis.com/falserverless/example_outputs/nano-banana-pro-edit-output.png","file_name":"nano-banana-pro-edit-output.png","content_type":"image/png"}]],"description":"All generated images, flattened across every target size. Order matches the order of ``results`` below: the first ``num_images_per_size`` entries correspond to ``target_sizes[0]`` and so on."},"results":{"type":"array","items":{"$ref":"#/components/schemas/SmartResizeResult"},"title":"Results","description":"Per-target-size breakdown with the requested width/height and the nano-banana-pro (aspect_ratio, resolution) preset that was used internally."},"description":{"type":"string","title":"Description","description":"The description of the generated images."}},"x-fal-order-properties":["images","description","results"]},"SmartResizeResult":{"type":"object","title":"SmartResizeResult","required":["images","description","width","height","aspect_ratio","resolution"],"properties":{"width":{"type":"integer","title":"Width","description":"The requested target width in pixels."},"height":{"type":"integer","title":"Height","description":"The requested target height in pixels."},"images":{"type":"array","items":{"$ref":"#/components/schemas/ImageFile"},"title":"Images","description":"The generated images."},"resolution":{"type":"string","title":"Resolution","description":"The nano-banana-pro resolution tier that was used internally for this target size."},"description":{"type":"string","title":"Description","description":"The description of the generated images."},"aspect_ratio":{"type":"string","title":"Aspect Ratio","description":"The nano-banana-pro aspect ratio that was used internally for this target size."}},"description":"Per-target-size resize result: a list of ``ImageFile`` objects all at the\nexact requested (width, height).","x-fal-order-properties":["images","description","width","height","aspect_ratio","resolution"]}}}}