Stable Diffusion 3 Turbo Image to Image

Distilled, few-step version of Stable Diffusion 3 Image to Image

~10.48s
~$0.08
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/stable-diffusion-3-turbo-img2img"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "mode": "image-to-image",
12    "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/sd3-turbo-i2i-input.jpg",
13    "prompt": "cyberpunk style frog, dark colors",
14    "strength": 1,
15    "output_format": "jpeg",
16    "base64": false
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22    result = response.json()
23    print(json.dumps(result, indent=2))
24else:
25    print(f"Error: {response.status_code}")
26    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/stable-diffusion-3-turbo-img2img

Parameters

imagerequired
string (uri)

Input Image

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/sd3-turbo-i2i-input.jpg"
moderequired
string

Type of mode.

Allowed values :
"image-to-image"
base64optional
boolean

Base64 encoding of the output image.

Default: false
output_formatoptional
string

Output format.

Default: "jpeg"
Allowed values :
"jpeg""png"
promptoptional
string

Prompt to render

strengthoptional
number

How much to transform the reference image

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