Image Superimpose V2 Serverless API
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-v2Parameters
base_imagerequiredstring (uri)Base image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/superimpose-v2-model.jpeg"overlay_imagerequiredstring (uri)Overlay image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt-logo-2.png"base64optionalbooleanBase64 encoding of the output image.
falsebg_remove_modeloptionalstringBG Removal Model
"Bria""Bria""IsNet""None"blend_modeoptionalstringBlend Mode
"multiply""multiply""normal""dissolve""darken""lighten""screen""overlay""soft light""hard light""vivid light"+4 moremaskoptionalstring (uri)background removal mask for the overlay image
nullmirroroptionalstringMirror
"None""horizontal""vertical"opacityoptionalnumberOpacity of the Overlay Image
90Range: 0 - 100rescale_factoroptionalnumberRescale factor for the overlay image
1Range: 0 - 100resize_methodoptionalstringResize Method for Overlay Image.
"nearest""nearest""box""bilinear""bicubic""lanczos"rotationoptionalintegerRotation
0Range: 0 - 3600x_percentoptionalintegerX Percent
50Range: 0 - 100y_percentoptionalintegerY Percent
80Range: 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