The SSD-1B model is an open-source diffusion-based text-to-image model. This foundational model represents a significant leap in image generation technology, particularly for 1024x1024images. This model was developed as part of Segmind's distillation series, SSD-1B offers remarkable speed and efficiency gains while maintaining high image quality.
Run SSD-1B with an API
Running the API with Clarifai's Python SDK
You can run the SSD-1B Model API using Clarifai’s Python SDK.
Export your PAT as an environment variable. Then, import and initialize the API Client.
import io
from PIL import Image
from clarifai.client.model import Model
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'''# Model Predictmodel_prediction = Model("https://clarifai.com/segmind/segmind-stable-diffusion/models/ssd-1b").predict_by_bytes(prompt.encode(),"text")image_bytes=model_prediction.outputs[0].data.image.base64
imageStream = io.BytesIO(image_bytes)imageFile = Image.open(imageStream)imageFile.save('my-image.jpeg')
You can also run SSD-1B API using other Clarifai Client Libraries like Java, cURL, NodeJS, PHP, etc here.
Using cURL to Make a Direct HTTP Call
To make a direct HTTP call to the SSD-1B API using cURL, you can use the following command:
curl -X POST "https://api.clarifai.com/v2/users/segmind/apps/segmind-stable-diffusion/models/ssd-1b/versions/5cc1a784916a402eac8b8f51391ed15b/outputs" \
-H "Authorization: Key YOUR_PAT_HERE" \
-H "Content-Type: application/json" \
-d '{
"inputs": [
{
"data": {
"text": {
"raw": "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"
}
}
}
],
"model": {
"model_version": {
"output_info": {
"params": {
"width": 1024,
"height":1024,
"guidance_scale": 7.4,
"num_inference_steps": 50
}
}
}
}
}'
SSD-1B
The SSD-1B model is designed with a primary focus on speed and efficiency, making it an ideal choice for various applications, including real-time image generation. Key features of SSD-1B include:
Designed for Speed
SSD-1B offers a 60% speed improvement in inference, making it suitable for applications where rapid image generation is essential compared to the SDXL base model.
Enhanced Compactness
SSD-1B is 50% more compact than the SDXL model, making it easier to deploy in different systems without sacrificing performance.
SSD-1B vs. SDXL
The SSD-1B model offers a compelling alternative to the SDXL 1.0 model. It is 50% smaller and 60% faster than the SDXL model while maintaining impressive image quality. The reduction in size and speed comes with minimal compromises, making it an attractive option for those looking for efficient and effective text-to-image generation.
Use Cases
The SSD-1B model has a wide range of potential use cases, including but not limited to:
Real-time image generation for applications and services.
Incorporation into creative projects and content generation.
Integration into products and services for businesses.
Limitations
While the SSD-1B model offers remarkable speed and efficiency, it does have limitations. It may not fully embody absolute photo-realism, especially in human depictions. Maintaining the fidelity of complex compositions can also be challenging due to its auto-encoding approach. These limitations pave the way for future enhancements and developments.
ID
Model Type ID
Text To Image
Input Type
text
Output Type
image
Description
SSD-1B is the diffusion-based text-to-image model and it's 50% smaller and 60% faster than SDXL 1.0.