This is a Flask-based web application that generates images using the Stable Diffusion model. Users can provide a text prompt and select an artistic style to generate highly detailed and professional images. The application also supports custom image dimensions (height and width) as long as they are divisible by 8.
Before running the application, ensure you have the following installed:
torch
)diffusers
libraryYou can install the required dependencies using the following command:
pip install torch torchvision diffusers flask pillow
If you plan to use GPU acceleration, ensure you have a compatible NVIDIA GPU with CUDA installed.
Clone this repository:
git clone https://github.com/yourusername/stable-diffusion-generator.git cd stable-diffusion-generator
Install the required dependencies:
pip install -r requirements.txt
Download the Stable Diffusion model:
runwayml/stable-diffusion-v1-5
) will be downloaded automatically when you run the application for the first time. Ensure you have sufficient disk space (~7GB).Start the Flask application:
python app.py
Open your browser and navigate to http://localhost:5000
.
Use the form to input:
Click "Generate Image" to create and view the generated image.
/
GET
/generate
POST
{ "prompt": "A futuristic cityscape", "style": "cyberpunk", "height": 768, "width": 768 }
{ "success": true, "image": "base64_encoded_image_string", "height": 768, "width": 768 }
{ "success": false, "error": "Error message" }
Contributions are welcome! If you'd like to contribute, please follow these steps:
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.
diffusers
library, which simplifies working with diffusion models.There are no models linked
There are no datasets linked
There are no models linked
There are no datasets linked