POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/ssd-1b"; const data = { "prompt": "with smoke, half ice and half fire and ultra realistic in detail.wolf, typography, dark fantasy, wildlife photography, vibrant, cinematic and on a black background", "negative_prompt": "scary, cartoon, painting", "samples": 1, "scheduler": "UniPC", "num_inference_steps": 25, "guidance_scale": 9, "seed": 36446545871, "img_width": 1024, "img_height": 1024, "base64": false }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
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 to render


negative_promptstr ( default: None )

Prompts to exclude, eg. 'bad anatomy, bad hands, missing fingers'


samplesint ( default: 1 ) Affects Pricing

Number of samples to generate.

min : 1,

max : 4


schedulerenum:str ( default: DPM2 Karras )

Type of scheduler.

Allowed values:


num_inference_stepsint ( default: 25 ) Affects Pricing

Number of denoising steps.

min : 20,

max : 100


guidance_scalefloat ( default: 7.5 )

Scale for classifier-free guidance

min : 1,

max : 25


seedint ( default: -1 )

Seed for image generation.

min : -1,

max : 999999999999999


img_widthenum:int ( default: 1024 ) Affects Pricing

Can only be 1024 for SDXL

Allowed values:


img_heightenum:int ( default: 1024 ) Affects Pricing

Can only be 1024 for SDXL

Allowed values:


base64boolean ( default: 1 )

Base64 encoding of the output image.

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.

SSD -1B

The Segmind Stable Diffusion Model (SSD-1B) sets a new standard in AI-driven image generation, offering a compact, efficient solution for transforming text into high-quality visuals. At 50% smaller and 60% faster than the Stable Diffusion XL (SDXL), it provides quick and seamless performance without sacrificing image quality.

Leveraging knowledge from expert models like SDXL, ZavyChromaXL, and JuggernautXL through a robust distillation strategy, SSD-1B ensures diverse and impressive visual outputs. Trained on rich datasets including Grit and Midjourney scrape data, it adeptly handles a broad spectrum of textual prompts. For those seeking a reliable and versatile text-to-image tool, Segmind’s SSD-1B is a top choice, ensuring both speed and visual excellence.

Advantages

  1. Speed and Efficiency: With a 60% speedup compared to its predecessor, SSD-1B ensures rapid text-to-image translations.

  2. Compact Design: Despite being 50% smaller than SDXL, it delivers high-quality visual outputs, showcasing its optimized design.

  3. Diverse Training: Its training on varied datasets ensures a broad spectrum of visual content generation based on user prompts.

  4. Knowledge Distillation: By leveraging insights from multiple expert models, SSD-1B offers a refined and enhanced performance.

Use Cases

  1. Art and Design: It can be used to generate artworks, designs, and other creative content, providing inspiration and enhancing the creative process.

  2. Research: Researchers can use the model to explore generative models, evaluate its performance, and push the boundaries of text-to-image generation.

  3. Safe Content Generation: It offers a safe and controlled way to generate content, reducing the risk of harmful or inappropriate outputs.

SSD -1B License

As for licensing, SSD -1B operates under the the Apache 2.0 license, a permissive open-source license endorsed by the Apache Software Foundation. It allows users to freely use, modify, and distribute the software, even in proprietary projects. The license also includes an express grant of patent rights from contributors to users and has provisions to handle contributions and protect against patent litigation.