https://github.com/prakhardoneria/stable-diffusion
Stable Text to Image
https://github.com/prakhardoneria/stable-diffusion
Last synced: 6 months ago
JSON representation
Stable Text to Image
- Host: GitHub
- URL: https://github.com/prakhardoneria/stable-diffusion
- Owner: PrakharDoneria
- Created: 2024-03-18T06:29:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-18T03:42:14.000Z (about 1 year ago)
- Last Synced: 2025-04-06T07:34:08.751Z (6 months ago)
- Language: Python
- Homepage: https://stable-diffusion-ivory.vercel.app
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Generation API
This API allows users to generate images based on prompts using a pre-trained model. It also provides functionality to upload the generated images to an image hosting service.
## Endpoints
### /prompt [POST]
This endpoint accepts a POST request with a prompt in the form data. It generates an image based on the provided prompt and returns the URL of the uploaded image.
#### Request Body
- `prompt`: The prompt for generating the image.
#### Response
- `200 OK`: If the image is successfully generated and uploaded, it returns a JSON object with the URL of the uploaded image.
```json
{
"image_url": "https://example.com/image.jpg"
}
```- `400 Bad Request`: If no prompt is provided in the request.
```json
{
"error": "No prompt provided"
}
```- `500 Internal Server Error`: If there's an error processing the image or uploading it to the image hosting service.
```json
{
"error": "Error processing image: "
}
``````json
{
"error": "Failed to retrieve image"
}
``````json
{
"error": "Failed to upload image to imgBB"
}
```## Example Usage
```bash
curl -X POST -d "prompt=Generate an image of a peaceful countryside with a small cottage surrounded by trees and a clear blue sky." https://api.example.com/prompt