This project provides an API endpoint for generating images using Stable Diffusion with the SimianLuo/LCM_Dreamshaper_v7 model. It supports image-to-image generation with customizable parameters.
POST /generate
Generates images based on the given parameters
- reset (
bool): Set toTrueto generate an image from the original. Default isFalse. - str (
float): Strength of the image transformation. Controls how much the original image is altered. Default is0.1. - gui (
float): Guidance scale to influence the prompt’s effect. Default is10.0. - num (
int): Number of inference steps to run. Default is5. - prompt (
string): The text prompt to guide the image generation. Default is a predefined prompt. - count (
int): Number of images to generate. Default is1. - width (
int): Width of the generated image in pixels. Default is128. - height (
int): Height of the generated image in pixels. Default is128.
GET /generate?prompt=Devil-man&str=0.5&gui=7.5&num=10&count=16&width=512&height=512This will generate 16 devil man images of size 512x512, each with a strength of 0.5, guidance scale of 7.5, and 10 inference steps from the previous.
- Clone the repository:
git clone https://github.com/JohnnyDeng6/sd3-server.git cd sd3-server - Install dependencies:
pip install -r requirements.txt
- Run the server:
python3 main.pyThe API will be available at http://localhost:8888/generate
