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.
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)
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
https://api.segmind.com/v1/stable-diffusion-3.5-large-txt2img
Parameters
prompt
requiredstring
Prompt for image generation
"~*~ aesthetic ~*~ #boho #fashion full-body 30-something woman laying on microfloral grass, candid pose, overlay reads Stable Diffusion 3.5, cheerful cursive typography font,"
sampler
requiredstring
Sampling method for image generation
"euler"
"euler"
"euler_cfg_pp"
"euler_ancestra"
"leuler_ancestral_cfg_pp"
"heun"
"heunpp2"
"dpm_2"
"dpm_2_ancestral"
"lms"
"dpm_fast"
+16 morescheduler
requiredstring
Scheduler for image generation
"sgm_uniform"
"normal"
"karras"
"exponential"
"sgm_uniform"
"simple"
"ddim_uniform"
"beta"
aspect_ratio
optionalstring
Aspect ratio of the output image. Select 'custom' to specify the width and height manually.
"custom"
"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"
base64
optionalboolean
Output as base64 encoded string
false
batch_size
optionalinteger
Number of images to generate in one batch
1
Range: 1 - 10guidance_scale
optionalnumber
Guidance scale for controlling how closely the generation matches the prompt
5.5
Range: 1 - 15height
optionalinteger
Height of the output image in pixels
1024
Range: 64 - 2048image_format
optionalstring
Output image format
"jpeg"
"jpeg"
"png"
"webp"
image_quality
optionalinteger
Image quality setting for output
95
Range: 10 - 100negative_prompt
optionalstring
The negative prompt to exclude unwanted details
"low quality, blurry"
seed
optionalinteger
Random number,seed for image generation
98552302
steps
optionalinteger
Number of inference steps for generating the image
30
Range: 10 - 70width
optionalinteger
Width of the output image in pixels
1024
Range: 64 - 2048Response Type
Returns: Text/JSON
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