Image Superimpose V2

Superimpose V2 elevates image editing! Seamlessly layer images with background removal, precise positioning, and flexible resizing options. Explore 14 blending modes to create stunning effects

~1.90s
~$0.001
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/superimpose-v2"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "base_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/superimpose-v2-model.jpeg",
12    "overlay_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt-logo-2.png",
13    "rescale_factor": 0.4,
14    "resize_method": "nearest",
15    "bg_remove_model": "Bria",
16    "blend_mode": "screen",
17    "opacity": 90,
18    "x_percent": 50,
19    "y_percent": 65,
20    "rotation": 0,
21    "base64": false
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27    result = response.json()
28    print(json.dumps(result, indent=2))
29else:
30    print(f"Error: {response.status_code}")
31    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/superimpose-v2

Parameters

base_imagerequired
string (uri)

Base image for the model

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/superimpose-v2-model.jpeg"
overlay_imagerequired
string (uri)

Overlay image for the model

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt-logo-2.png"
base64optional
boolean

Base64 encoding of the output image.

Default: false
bg_remove_modeloptional
string

BG Removal Model

Default: "Bria"
Allowed values :
"Bria""IsNet""None"
blend_modeoptional
string

Blend Mode

Default: "multiply"
Allowed values (14 total):
"multiply""normal""dissolve""darken""lighten""screen""overlay""soft light""hard light""vivid light"+4 more
maskoptional
string (uri)

background removal mask for the overlay image

Default: null
mirroroptional
string

Mirror

Allowed values :
"None""horizontal""vertical"
opacityoptional
number

Opacity of the Overlay Image

Default: 90Range: 0 - 100
rescale_factoroptional
number

Rescale factor for the overlay image

Default: 1Range: 0 - 100
resize_methodoptional
string

Resize Method for Overlay Image.

Default: "nearest"
Allowed values :
"nearest""box""bilinear""bicubic""lanczos"
rotationoptional
integer

Rotation

Default: 0Range: 0 - 360
Allowed values :
0
x_percentoptional
integer

X Percent

Default: 50Range: 0 - 100
y_percentoptional
integer

Y Percent

Default: 80Range: 0 - 100

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out