Skip to main content
API Reference for bria/image-edit-expand, served by Comfy Router from Bria.

Quick start

Create a key in your Comfy workspace and export it as COMFY_API_KEY. The Python and TypeScript snippets use the Comfy SDKs (pip install comfy-sdk, npm install @comfyorg/sdk); the cURL snippet is the same call over raw HTTP. Model ID: bria/image-edit-expand Endpoint: POST https://api.comfy.org/v2/models/bria/image-edit-expand

Schema

Input

`1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9` | number
Aspect ratio of the expanded canvas, either a predefined ratio string (“1:1”, “2:3”, “3:2”, “3:4”, “4:3”, “4:5”, “5:4”, “9:16”, “16:9”) or a float between 0.5 and 3.0. When provided, canvas_size, original_image_size, and original_image_location are ignored.Range: 0.5 to 3
integer[]
Width and height of the expanded canvas in pixels. Defaults to [1000, 1000]. Maximum canvas area is 5000x5000 pixels.
string
required
The image to expand. Supported input types are Base64-encoded string or URL pointing to a publicly accessible image file. Accepted formats JPEG, JPG, PNG, WEBP.
string
A text prompt specifying concepts, styles, or objects to exclude from the expanded area.
integer[]
Position [x, y] of the original image’s top-left corner on the canvas. Required together with original_image_size when aspect_ratio is not provided.
integer[]
Width and height of the original image placed on the canvas. Required together with original_image_location when aspect_ratio is not provided.
boolean
Controls whether partially transparent areas from the input image are retained in the output.
string
Text prompt guiding the content generated in the expanded area. Auto-generated when omitted.
boolean
When enabled, applies content moderation to the prompt. Returns 422 if the prompt fails moderation.
integer
Seed for deterministic generation. If omitted, a random seed is used.
boolean
When false (default), the request is processed asynchronously. When true, the API holds the connection open until complete.
boolean
When enabled, applies content moderation to input visual. Returns 422 if the image fails moderation.
boolean
When enabled, applies content moderation to result visual. Returns 422 if the output fails moderation.
Generated from the schema Router serves at GET /v2/models/bria/image-edit-expand/openapi.json, the same document it validates a call against before the request reaches the provider.

Output

object
Error object (only present when status is ERROR)
integer
Error code.
string
Additional error details.
string
Error message.
string
Unique identifier for the request.
object
Result object (only present when status is COMPLETED)
string
URL of the generated/edited image.
string
Original prompt.
string
Refined version of the prompt.
integer
Seed used for generation.
string
The detailed JSON structured prompt.
string
URL of the generated video.
string
Current status of the request.Possible values: IN_PROGRESS, COMPLETED, ERROR, UNKNOWN

Examples

Input

Output

Before you ship

The SDKs create an Idempotency-Key and reuse it for automatic retries. For manual retries, reuse the original key. Router can hold the connection for up to 10 minutes. When a request fails, Router sends an X-Comfy-Error-Type response header explaining why. A 422 means Router rejected the input before calling the provider. Download generated assets promptly because result URLs can expire.

Headers

Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

Using the Router API

Model discovery, validation errors, retries, and billing.

Limitations

What Router does not do today, and what to use instead.