Image Superimpose
Superimpose model lets you to create captivating visuals by seamlessly overlaying one image on top of another. It streamlines your image layering process, allowing you to bring your creative vision to life effortlessly.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/superimpose"
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/tshirt+mock.jpg",
12 "overlay_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt+logo.png",
13 "rescale_factor": 0.4,
14 "resize_method": "nearest-exact",
15 "overlay_resize": "Resize by rescale_factor",
16 "opacity": 1,
17 "height": 1024,
18 "width": 1024,
19 "x_offset": 320,
20 "y_offset": 620,
21 "rotation": 0,
22 "base64": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/superimpose"
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/tshirt+mock.jpg",
12 "overlay_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt+logo.png",
13 "rescale_factor": 0.4,
14 "resize_method": "nearest-exact",
15 "overlay_resize": "Resize by rescale_factor",
16 "opacity": 1,
17 "height": 1024,
18 "width": 1024,
19 "x_offset": 320,
20 "y_offset": 620,
21 "rotation": 0,
22 "base64": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text)API Endpoint
https://api.segmind.com/v1/superimposeParameters
base_imagerequiredstring (uri)Base image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt+mock.jpg"overlay_imagerequiredstring (uri)Overlay image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/tshirt+logo.png"base64optionalbooleanBase64 encoding of the output image.
falseheightoptionalintegerHeight
1024maskoptionalstring (uri)Mask for the overlay image
opacityoptionalnumberOpacity of the Overlay Image
1Range: 0 - 1overlay_resizeoptionalstringOverlay Image Resize
"Resize by rescale_factor""Resize by rescale_factor""None""Fit""Resize to width & heigth"rescale_factoroptionalnumberRescale factor for the overlay image
1Range: 0 - 16resize_methodoptionalstringResize Method for Overlay Image.
"nearest-exact""nearest-exact""bilinear""area"rotationoptionalintegerRotation
0Range: 0 - 360widthoptionalintegerWidth
1024x_offsetoptionalintegerX Offset
0y_offsetoptionalintegerY Offset
0Response 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