POST
javascript
1const axios = require('axios'); 2 3 4const api_key = "YOUR API-KEY"; 5const url = "https://api.segmind.com/v1/stable-diffusion-3.5-turbo-txt2img"; 6 7const data = { 8 "prompt": "A panda in a glowing tech-infused jacket, standing in front of a bustling cyberpunk market, his T-shirt displaying 'Segmind'. Neon lights illuminate his face, with a futuristic cityscape behind him. Reflections shimmer on the wet pavement.", 9 "negative_prompt": "low quality, blurry", 10 "steps": 4, 11 "guidance_scale": 1, 12 "seed": 98552302, 13 "sampler": "dpmpp_2m", 14 "scheduler": "sgm_uniform", 15 "width": 1024, 16 "height": 1024, 17 "aspect_ratio": "custom", 18 "batch_size": 1, 19 "image_format": "jpeg", 20 "image_quality": 95, 21 "base64": false 22}; 23 24(async function() { 25 try { 26 const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); 27 console.log(response.data); 28 } catch (error) { 29 console.error('Error:', error.response.data); 30 } 31})();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr *

Prompt for image generation


negative_promptstr ( default: low quality, blurry )

The negative prompt to exclude unwanted details


stepsint ( default: 4 )

Number of inference steps for generating the image

min : 10,

max : 70


guidance_scalefloat ( default: 1 )

Guidance scale for controlling how closely the generation matches the prompt

min : 1,

max : 15


seedint ( default: 98552302 )

Random number,seed for image generation


samplerenum:str *

Sampling method for image generation

Allowed values:


schedulerenum:str *

Scheduler for image generation

Allowed values:


widthint ( default: 1024 )

Width of the output image in pixels

min : 64,

max : 2048


heightint ( default: 1024 )

Height of the output image in pixels

min : 64,

max : 2048


aspect_ratioenum:str ( default: custom )

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

Allowed values:


batch_sizeint ( default: 1 )

Number of images to generate in one batch

min : 1,

max : 10


image_formatenum:str ( default: jpeg )

Output image format

Allowed values:


image_qualityint ( default: 95 )

Image quality setting for output

min : 10,

max : 100


base64bool ( default: 1 )

Output as base64 encoded string

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Stable Diffusion 3.5 Turbo Text-to-Image

Stable Diffusion 3.5 Turbo Text-to-Image (SD3.5 Turbo) is the latest and most advanced addition to the Stable Diffusion family of image-to-image models. SD3.5 text-to-image Turbo is designed to be more resource-efficient, making it a better choice for users with limited computational resources. Due to its smaller size, SD3.5 Turbo can run efficiently on consumer-grade hardware, including consumer PCs and laptops, as well as enterprise-tier GPUs. SD3.5 Turbo is designed to be more resource-efficient, making it a better choice for users with limited computational resources.

Stable Diffusion 3.5 Turbo Text-to-Image Capabilities

SD3.5 Turbo crafts stunningly realistic images, breaking new ground in photorealistic generation. It also tackles intricate prompts with multiple subjects, even if you have a typo or two. SD3.5 Turbo incorporates typography within your images with unparalleled precision, making your message shine.