Skip to main content
Endpoint: POST https://fal.run/fal-ai/imageutils/rembg Endpoint ID: fal-ai/imageutils/rembg

Try it in the Playground

Run this model interactively with your own prompts.

Quick Start

import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/imageutils/rembg",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)

Input Schema

image_url
string
required
Input image url.
sync_mode
boolean
default:"false"
If True, the media will be returned as a data URI and the output data won’t be available in the request history.
crop_to_bbox
boolean
default:"false"
If set to true, the resulting image be cropped to a bounding box around the subject

Output Schema

image
Image
required
Background removed image.

Input Example

{
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg",
  "sync_mode": false,
  "crop_to_bbox": false
}

Output Example

{
  "image": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019,
    "width": 1024,
    "height": 1024
  }
}

Limitations

  • num_inference_steps range: 2 to 50
  • ensemble_size range: 2 to 50
  • processing_res range: 0 to 2048