Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your provider API key or Bifrost authentication token. Virtual keys (prefixed with sk-bf-) can also be passed here.

Body

multipart/form-data
model
string
required

Model identifier in format provider/model

image
file
required

Image file to edit. Use field name image for a single file or image[] for multiple files.

prompt
string

Text prompt describing the edit. Required unless type is background_removal.

mask
file

Optional mask image for inpainting (transparent areas indicate regions to edit)

type
enum<string>

Type of edit operation

Available options:
inpainting,
outpainting,
background_removal
n
integer

Number of images to generate

Required range: 1 <= x <= 10
size
enum<string>

Size of the output image

Available options:
256x256,
512x512,
1024x1024,
1536x1024,
1024x1536,
auto
response_format
enum<string>
default:url

Format of the response

Available options:
url,
b64_json
stream
boolean
default:false

When true, stream the response via Server-Sent Events

background
enum<string>

Background type for the image

Available options:
transparent,
opaque,
auto
input_fidelity
enum<string>

How closely to follow the original image

Available options:
low,
high
partial_images
integer

Number of partial images to generate when streaming

Required range: 0 <= x <= 3
quality
enum<string>

Quality of the output image

Available options:
auto,
high,
medium,
low,
standard
output_format
enum<string>

Output image format

Available options:
png,
webp,
jpeg
num_inference_steps
integer

Number of inference steps

seed
integer

Seed for reproducible editing

output_compression
integer

Compression level (0-100%)

Required range: 0 <= x <= 100
negative_prompt
string

What to avoid in the edit

user
string

User identifier for tracking

fallbacks
object[]

Fallback models to try if primary model fails

Response

Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when stream=true. When streaming, events are sent with the following event types:

  • image_edit.partial_image: Intermediate image chunks with base64-encoded image data
  • image_edit.completed: Final event for each image with usage information
  • error: Error events with error details
id
string

Unique identifier for the generation request

created
integer<int64>

Unix timestamp when the image was created

model
string

Model used for generation

data
object[]

Array of generated images

background
string

Background type for the image

output_format
enum<string>

Output image format

Available options:
png,
webp,
jpeg
quality
string

Quality of the generated image

size
enum<string>

Size of the generated image

Available options:
256x256,
512x512,
1024x1024,
1792x1024,
1024x1792,
1536x1024,
1024x1536,
auto
usage
object
extra_fields
object

Additional fields included in responses