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": "a futuristic cityscape at dusk, neon lights, reflections in water, ultrarealistic, high contrast, vibrant", "negative_prompt": "blurry,out of focus", "samples": 2, "scheduler": "DPM Multi", "num_inference_steps": 45, "guidance_scale": 7, "seed": 9876543210, "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 *

Descriptive phrases guide the model's output. Include vivid details and context for diverse results.


negative_promptstr ( default: blurry,out of focus )

Filters out unwanted elements. Use to enforce clarity and aesthetics.


samplesint ( default: 2 ) Affects Pricing

Specifies the number of images to generate. More samples increase diversity, fewer for speed.

min : 1,

max : 4


schedulerenum:str ( default: DPM Multi )

Determines denoising pattern. 'DPM Multi' for balanced outputs, 'Euler' for sharper results.

Allowed values:


num_inference_stepsint ( default: 45 ) Affects Pricing

Controls detail via denoising steps. Raise steps for intricate textures, lower for speed.

min : 20,

max : 100


guidance_scalefloat ( default: 7 )

Determines output fidelity to prompt. Higher for precision, lower for creative variance.

min : 1,

max : 25


seedint ( default: 9876543210 )

Ensures repeatable results by fixing randomness. User-defined or random for unique images.

min : -1,

max : 999999999999999


img_widthenum:int ( default: 1024 ) Affects Pricing

Defines output width; set to 1024 for best clarity and detail.

Allowed values:


img_heightenum:int ( default: 1024 ) Affects Pricing

Determines output height; fixed at 1024 for optimal resolution.

Allowed values:


base64boolean ( default: 1 )

Encodes images in Base64 for seamless integration. Enable if encoding is needed.

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: Compact Text-to-Image Model

What is SSD-1B?

SSD-1B is a high-performance text-to-image model developed by Segmind that delivers impressive visual results while being significantly more efficient than its predecessors. This compact AI model is 50% smaller and 60% faster than Stable Diffusion XL, making it ideal for developers who need quick turnaround times without sacrificing image quality. Through advanced knowledge distillation techniques, SSD-1B inherits capabilities from expert models like SDXL and JuggernautXL, ensuring diverse outputs across artistic styles and photorealistic renderings. The model generates images at a fixed 1024×1024 resolution, optimized for clarity and detail.

Key Features

  • Optimized Performance: 50% smaller model size and 60% faster generation compared to SDXL
  • Knowledge Distillation: Trained using insights from SDXL, JuggernautXL, and other expert models
  • Diverse Training Data: Built on comprehensive datasets including Grit and Midjourney
  • Fixed High Resolution: Produces 1024×1024 pixel images for consistent, high-quality outputs
  • Versatile Style Range: Handles photorealistic, artistic, and stylized image generation effectively
  • Advanced Parameter Control: Fine-tune outputs with schedulers, guidance scale, and inference steps

Best Use Cases

Creative Industries: Graphic designers and illustrators can rapidly prototype concepts, create mood boards, or generate variations of visual ideas without long render times.

Marketing and Advertising: Generate campaign visuals, social media content, or product mockups quickly while maintaining professional quality standards.

Game Development: Create concept art, environment designs, or character references during early development phases.

Research and Education: Academics studying generative AI can experiment with a performant model that balances quality and computational efficiency.

Content Creation: Bloggers, YouTubers, and digital creators can produce custom imagery for thumbnails, headers, and promotional materials.

Prompt Tips and Output Quality

Crafting Effective Prompts: Include vivid descriptive details, specify artistic style or mood, and add technical terms like "ultrarealistic," "high contrast," or "cinematic lighting" to guide the output. For example: "a futuristic cityscape at dusk, neon lights, reflections in water, ultrarealistic, high contrast, vibrant."

Using Negative Prompts: Filter unwanted elements by specifying terms like "blurry, out of focus, distorted" to enforce clarity and aesthetic consistency.

Parameter Optimization:

  • Inference Steps (20-100): Start with 45 steps for balanced quality. Increase to 70-100 for intricate textures and fine details; reduce to 20-30 for faster iteration.
  • Guidance Scale (1-25): Use 7-10 for prompt-faithful results. Lower values (3-5) allow creative interpretation; higher values (12-18) enforce strict adherence.
  • Scheduler Selection: "DPM Multi" provides balanced outputs for most use cases. Try "Euler" for sharper edges or "Heun" for smoother gradients.
  • Seed Control: Set a specific seed value for reproducible results across iterations, essential for A/B testing prompts.

FAQs

Is SSD-1B open-source?
SSD-1B is available through Segmind's platform. Check Segmind's licensing terms for commercial usage rights and integration options.

How does SSD-1B compare to Stable Diffusion XL?
SSD-1B is 50% smaller and 60% faster than SDXL while maintaining comparable image quality through knowledge distillation. It's optimized for speed-critical applications where SDXL might be too resource-intensive.

What resolution does SSD-1B generate?
The model produces images at a fixed 1024×1024 pixel resolution, optimized for detail and clarity without requiring resolution adjustments.

Which scheduler should I use for photorealistic images?
Start with "DPM Multi" for balanced realism. If results need more sharpness, try "Euler" or "DPM2 Karras." Photorealism also benefits from higher inference steps (60-80).

Can I generate multiple variations of the same prompt?
Yes, adjust the samples parameter (1-4 images) or change the seed value while keeping other parameters constant to explore variations efficiently.

What's the ideal guidance scale for creative exploration?
For creative freedom, use guidance scale values between 3-6. This allows the model to interpret your prompt more loosely, producing unexpected and artistic variations.