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
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)
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
https://api.segmind.com/v1/superimpose-v2
Parameters
base_image
requiredstring (uri)
Base image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/superimpose-v2-model.jpeg"
overlay_image
requiredstring (uri)
Overlay image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt-logo-2.png"
base64
optionalboolean
Base64 encoding of the output image.
false
bg_remove_model
optionalstring
BG Removal Model
"Bria"
"Bria"
"IsNet"
"None"
blend_mode
optionalstring
Blend Mode
"multiply"
"multiply"
"normal"
"dissolve"
"darken"
"lighten"
"screen"
"overlay"
"soft light"
"hard light"
"vivid light"
+4 moremask
optionalstring (uri)
background removal mask for the overlay image
null
mirror
optionalstring
Mirror
"None"
"horizontal"
"vertical"
opacity
optionalnumber
Opacity of the Overlay Image
90
Range: 0 - 100rescale_factor
optionalnumber
Rescale factor for the overlay image
1
Range: 0 - 100resize_method
optionalstring
Resize Method for Overlay Image.
"nearest"
"nearest"
"box"
"bilinear"
"bicubic"
"lanczos"
rotation
optionalinteger
Rotation
0
Range: 0 - 3600
x_percent
optionalinteger
X Percent
50
Range: 0 - 100y_percent
optionalinteger
Y Percent
80
Range: 0 - 100Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out