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})();
Prompt for image generation
The negative prompt to exclude unwanted details
Number of inference steps for generating the image
min : 10,
max : 70
Guidance scale for controlling how closely the generation matches the prompt
min : 1,
max : 15
Random number,seed for image generation
Sampling method for image generation
Allowed values:
Scheduler for image generation
Allowed values:
Width of the output image in pixels
min : 64,
max : 2048
Height of the output image in pixels
min : 64,
max : 2048
Aspect ratio of the output image. Select 'custom' to specify the width and height manually.
Allowed values:
Number of images to generate in one batch
min : 1,
max : 10
Output image format
Allowed values:
Image quality setting for output
min : 10,
max : 100
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 (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.
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.