shailex/stable-diffusion-api
1
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Stable Diffusion Image Generator
A web application that uses Stable Diffusion to generate images from text prompts.
Live Demo
The application is deployed and accessible at:
- Frontend: https://shailesh-tagadghar.github.io/image-generation/
- Backend API: [The URL will be updated after deployment]
Features
- Generate images from text descriptions using Stable Diffusion
- Control number of images, inference steps, and guidance scale
- Easy to use web interface
- Download generated images
Architecture
This application consists of two parts:
- Frontend: Static HTML/JS/CSS hosted on GitHub Pages
- Backend: Flask API hosted on Hugging Face Spaces that runs the Stable Diffusion model
Setup and Deployment
Frontend Setup
- Fork or clone this repository
- Update the
API_URLin theindex.htmlfile to point to your deployed backend - Enable GitHub Pages in your repository settings
Backend Setup
The backend can be deployed to Hugging Face Spaces:
- Create a new Space on Hugging Face
- Choose the Docker template
- Upload the
app.py,requirements.txt, andDockerfilefiles - Your API will be available at the URL provided by Hugging Face
Local Development
To run the application locally:
- Clone the repository
- Install the requirements:
pip install -r requirements.txt - Run the Flask app:
python app.py - Open
index.htmlin your browser (make sure to update the API URL)
Credits
- Built using Stable Diffusion
- Created by Shailesh Tagadghar
