This is a Flask-based web application that generates images using the SDXL ImageGenerator library. Users can send prompts to the app and receive generated images in response.
To run this application, you need to have the following installed:
- Python (3.6 or higher)
- Flask
- Flask-CORS
- SDXL ImageGenerator
-
Clone this repository to your local machine:
git clone https://github.com/h4shell/stableDiffusion-API.git cd stableDiffusion-API
-
Install the required packages using pip:
pip install -r requirements.txt
-
Start the Flask server by running the following command:
python server.py
The server will start and listen on http://0.0.0.0:5000/.
-
You can now send HTTP requests to the server to generate images based on prompts.
-
URL:
/
-
Method: GET
-
Parameters:
prompt
(string, required): The prompt text for image generation.count
(string, optional): number of images in output.
-
Response:
- If successful:
{ "image": "https://replicate.delivery/pbxt/.." }
- If an error occurs:
{ "status": false, "error": "error_message" }
- If successful:
Assuming the server is running on http://localhost:5000/
, you can generate images by sending a GET request with the prompt parameter:
curl "http://localhost:5000/?prompt=beautiful%20landscape"
Response:
{
"image": "https://replicate.delivery/pbxt/.."
}
Contributions are welcome! If you find any issues or want to enhance this project, feel free to submit a pull request.
This project is licensed under the MIT License.