Stable Diffusion 3.5 Large Text to Image

Stable Diffusion 3.5 Large offers exceptional customizability, efficient performance on consumer hardware, and diverse image outputs that accurately represent different skin tones and features, all while maintaining high-quality results and strong prompt adherence.

~17.47s
~$0.014
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/stable-diffusion-3.5-large-txt2img"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "~*~ aesthetic ~*~ #boho #fashion full-body 30-something woman laying on microfloral grass, candid pose, overlay reads Stable Diffusion 3.5, cheerful cursive typography font,",
12    "negative_prompt": "low quality, blurry",
13    "steps": 25,
14    "guidance_scale": 5.5,
15    "seed": 98552302,
16    "sampler": "euler",
17    "scheduler": "sgm_uniform",
18    "width": 1024,
19    "height": 1024,
20    "aspect_ratio": "custom",
21    "batch_size": 1,
22    "image_format": "jpeg",
23    "image_quality": 95,
24    "base64": false
25}
26
27response = requests.post(url, headers=headers, json=data)
28
29if response.status_code == 200:
30    result = response.json()
31    print(json.dumps(result, indent=2))
32else:
33    print(f"Error: {response.status_code}")
34    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/stable-diffusion-3.5-large-txt2img

Parameters

promptrequired
string

Prompt for image generation

Default: "~*~ aesthetic ~*~ #boho #fashion full-body 30-something woman laying on microfloral grass, candid pose, overlay reads Stable Diffusion 3.5, cheerful cursive typography font,"
samplerrequired
string

Sampling method for image generation

Default: "euler"
Allowed values (26 total):
"euler""euler_cfg_pp""euler_ancestra""leuler_ancestral_cfg_pp""heun""heunpp2""dpm_2""dpm_2_ancestral""lms""dpm_fast"+16 more
schedulerrequired
string

Scheduler for image generation

Default: "sgm_uniform"
Allowed values :
"normal""karras""exponential""sgm_uniform""simple""ddim_uniform""beta"
aspect_ratiooptional
string

Aspect ratio of the output image. Select 'custom' to specify the width and height manually.

Default: "custom"
Allowed values :
"custom""1:1 square 1024x1024""3:4 portrait 896x1152""5:8 portrait 832x1216""9:16 portrait 768x1344""9:21 portrait 640x1536""4:3 landscape 1152x896""3:2 landscape 1216x832""16:9 landscape 1344x768""21:9 landscape 1536x640"
base64optional
boolean

Output as base64 encoded string

Default: false
batch_sizeoptional
integer

Number of images to generate in one batch

Default: 1Range: 1 - 10
guidance_scaleoptional
number

Guidance scale for controlling how closely the generation matches the prompt

Default: 5.5Range: 1 - 15
heightoptional
integer

Height of the output image in pixels

Default: 1024Range: 64 - 2048
image_formatoptional
string

Output image format

Default: "jpeg"
Allowed values :
"jpeg""png""webp"
image_qualityoptional
integer

Image quality setting for output

Default: 95Range: 10 - 100
negative_promptoptional
string

The negative prompt to exclude unwanted details

Default: "low quality, blurry"
seedoptional
integer

Random number,seed for image generation

Default: 98552302
stepsoptional
integer

Number of inference steps for generating the image

Default: 30Range: 10 - 70
widthoptional
integer

Width of the output image in pixels

Default: 1024Range: 64 - 2048

Response Type

Returns: Text/JSON

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