Stable Diffusion Image Generator with Inception Score
This repository uses the Stable Diffusion
model from the diffusers
library to generate images based on a text prompt and returns the generated image in base64 format.
How It Works
- The user sends a prompt (e.g., "A red apple on a wooden table").
- The
Stable Diffusion
model generates images based on the provided prompt. - The first generated image is returned as a base64-encoded PNG image.
Model Used
- Model:
CompVis/stable-diffusion-v1-4
- Library: diffusers
- The model is pre-trained, and inference is run on a GPU (if available) or CPU.
How to Use the Inference API
You can use this model via the Hugging Face Inference API by making a POST request with the following format:
curl -X POST https://api-inference.huggingface.co/models/YOUR_USERNAME/stable-diffusion-make -H "Authorization: Bearer YOUR_API_TOKEN" -H "Content-Type: application/json" -d '{"prompt": "A red apple on a wooden table", "num_images": 1}'
Parameters:
prompt
: The text prompt for image generation.num_images
: Number of images to generate (default is 1).
The response will return the first image encoded in base64 format.
License
MIT License
- Downloads last month
- 0
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.
Evaluation results
- Inception Score on LAION-400Mself-reported9.000
- FID on LAION-400Mself-reported25.000