Stable Diffusion 3 Medium Image to Image
Stable Diffusion 3 Medium image-to-image is a cutting-edge AI tool that uses advanced image-to-image technology to transform one image into another.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/sd3-med-img2img"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "photo of a boy holding phone on table,3d pixar style",
12 "negative_prompt": "low quality,less details",
13 "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/sd3-img2img-ip.jpg",
14 "num_inference_steps": 20,
15 "guidance_scale": 5,
16 "seed": 698845,
17 "samples": 1,
18 "strength": 0.7,
19 "sampler": "dpmpp_2m",
20 "scheduler": "sgm_uniform",
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/sd3-med-img2img"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "photo of a boy holding phone on table,3d pixar style",
12 "negative_prompt": "low quality,less details",
13 "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/sd3-img2img-ip.jpg",
14 "num_inference_steps": 20,
15 "guidance_scale": 5,
16 "seed": 698845,
17 "samples": 1,
18 "strength": 0.7,
19 "sampler": "dpmpp_2m",
20 "scheduler": "sgm_uniform",
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/sd3-med-img2img
Parameters
image
requiredstring (uri)
Input image
"https://segmind-sd-models.s3.amazonaws.com/display_images/sd3-img2img-ip.jpg"
prompt
requiredstring
Text prompt for image generation
"photo of a boy holding phone on table,3d pixar style"
base64
optionalboolean
Base64 encoding of the output image
false
guidance_scale
optionalnumber
Guidance scale for image generation
5
Range: 1 - 20negative_prompt
optionalstring
Negative text prompt to avoid certain qualities
"low quality,less details"
num_inference_steps
optionalinteger
Number of inference steps for image generation
20
Range: 1 - 100sampler
optionalstring
Sampler for the image generation process
"dpmpp_2m"
"euler"
"euler_pp"
"euler_ancestral"
"euler_ancestral_pp"
"heun"
"heunpp2"
"dpm_2"
"dpm_2_ancestral"
"lms"
"dpm_fast"
+17 moresamples
optionalinteger
Number of samples to generate
1
scheduler
optionalstring
Scheduler for the image generation process
"sgm_uniform"
"normal"
"karras"
"exponential"
"sgm_uniform"
"simple"
"ddim_uniform"
seed
optionalinteger
Seed for random number generation
698845
strength
optionalnumber
Strength of the image transformation
0.7
Range: 0 - 1Response 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