RemBG v1.4
RemBG v1.4 is an optimized image background removal model focused on rapid and accurate separation of foreground subjects from background. It uses lightweight segmentation to produce clean alpha masks for visual assets, product photos, and portraits without manual editing.
API Options
Platform-level options for task execution and delivery.
-
taskType
string required value: removeBackground -
Identifier for the type of task being performed
-
taskUUID
string required UUID v4 -
UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.
-
outputType
string default: URL -
Image output type.
Allowed values 3 values
-
outputFormat
string default: JPG -
Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.
- `JPG`: Best for photorealistic images with smaller file sizes (no transparency).
- `PNG`: Lossless compression, supports high quality and transparency (alpha channel).
- `WEBP`: Modern format providing superior compression and transparency support.
**Transparency**: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., `PNG`, `WEBP`, `TIFF`). `JPG` does not support transparency.Allowed values 3 values
-
outputQuality
integer min: 20 max: 99 default: 95 -
Compression quality of the output. Higher values preserve quality but increase file size.
-
webhookURL
string URI -
Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.
Learn more 1 resource
- Webhooks PLATFORM
- Webhooks
-
deliveryMethod
string default: sync -
Determines how the API delivers task results.
Allowed values 2 values
- Returns complete results directly in the API response.
- Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse.
Learn more 1 resource
- Task Polling PLATFORM
-
uploadEndpoint
string URI -
Specifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.
Common use cases:
- Cloud storage: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.
- CDN integration: Upload to content delivery networks for immediate distribution.
// S3 presigned URL for secure upload https://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600 // Google Cloud Storage presigned URL https://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789 // Custom storage endpoint https://storage.example.com/uploads/generated-image.jpgThe content data will be sent as the request body to the specified URL when generation is complete.
-
ttl
integer min: 60 -
Time-to-live (TTL) in seconds for generated content. Only applies when
outputTypeisURL.
-
includeCost
boolean default: false -
Include task cost in the response.
Inputs
Input resources for the task (images, audio, etc). These must be nested inside the inputs object.
inputs object.-
inputs»imageimage
string required -
Image input (UUID, URL, Data URI, or Base64).
Generation Parameters
Core parameters for controlling the generated content.
-
model
string required value: runware:109@1 -
Identifier of the model to use for generation.
Learn more 3 resources
Settings
Technical parameters to fine-tune the inference process. These must be nested inside the settings object.
settings object.-
settings»alphaMattingalphaMatting
boolean default: false -
Enable alpha matting to refine edges of the foreground object.
-
settings»alphaMattingBackgroundThresholdalphaMattingBackgroundThreshold
integer min: 1 max: 255 default: 10 -
Threshold used in alpha matting to refine background areas. Higher values remove more background but increase computation time.
-
settings»alphaMattingErodeSizealphaMattingErodeSize
integer min: 1 max: 255 default: 10 -
Size of the erosion operation used to smooth the edges of the foreground object.
-
settings»alphaMattingForegroundThresholdalphaMattingForegroundThreshold
integer min: 1 max: 255 default: 240 -
Threshold used in alpha matting to distinguish foreground from background. Affects edge sharpness.
-
settings»postProcessMaskpostProcessMask
boolean default: false -
Enable additional post-processing to improve mask accuracy.
-
settings»returnOnlyMaskreturnOnlyMask
boolean default: false -
Return only the mask instead of the processed image.
-
settings»rgbargba
array of integers min: 0 max: 255 items: 4 default: 255,255,255,0 -
Background color as
[red, green, blue, alpha]array.
Pixelated Toy Robot Portrait
{
"taskType": "removeBackground",
"taskUUID": "cdc8c516-310a-4646-b983-9cd3ec6993e4",
"model": "runware:109@1",
"settings": {
"rgba": [
255,
255,
255,
0
],
"postProcessMask": true,
"alphaMatting": true,
"alphaMattingForegroundThreshold": 230,
"alphaMattingBackgroundThreshold": 15,
"alphaMattingErodeSize": 8
},
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/835cc7d5-93d0-4af4-a427-2427f170084d.jpg"
}
}{
"taskType": "imageBackgroundRemoval",
"taskUUID": "cdc8c516-310a-4646-b983-9cd3ec6993e4",
"imageUUID": "7e745c5e-2a3a-4a44-b9d0-1920c8866d14",
"imageURL": "https://im.runware.ai/image/os/a13d12/ws/3/ii/7e745c5e-2a3a-4a44-b9d0-1920c8866d14.png",
"cost": 0.0013,
"inputImageUUID": "5071606e-5a78-4c28-bde5-66a1534ddde0"
}Pixel Sprite Character Cutout
{
"taskType": "removeBackground",
"taskUUID": "277fb836-9d5c-4b60-b80b-70441b2e97e4",
"model": "runware:109@1",
"settings": {
"rgba": [
255,
255,
255,
0
],
"postProcessMask": true,
"alphaMatting": true,
"alphaMattingForegroundThreshold": 235,
"alphaMattingBackgroundThreshold": 12,
"alphaMattingErodeSize": 4
},
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/35b37672-4a53-4bbd-8781-94b3895832d1.jpg"
}
}{
"taskType": "imageBackgroundRemoval",
"taskUUID": "277fb836-9d5c-4b60-b80b-70441b2e97e4",
"imageUUID": "0755f8e6-2323-417b-8f6f-962e9cb8877e",
"imageURL": "https://im.runware.ai/image/os/a24d12/ws/3/ii/0755f8e6-2323-417b-8f6f-962e9cb8877e.png",
"cost": 0.0013,
"inputImageUUID": "9cd88089-8856-4e22-9b3a-9622ad153ef1"
}