|
1 | 1 | <div align="center"> |
2 | 2 |
|
3 | | -<h1>Automatic1111 | Worker</h1> |
| 3 | +<h1>Automatic1111 Stable Diffusion web UI</h1> |
4 | 4 |
|
5 | 5 | [](https://www.runpod.io/console/hub/runpod-workers/worker-a1111) |
6 | | -[](https://github.com/runpod-workers/worker-template/actions/workflows/CI-test_worker.yml) |
7 | | - |
8 | | -[](https://github.com/runpod-workers/worker-template/actions/workflows/CD-docker_dev.yml) |
9 | 6 |
|
10 | | -This worker is a RunPod worker that uses the Stable Diffusion model for AI tasks. The worker is built upon the Stable Diffusion WebUI, which is a user interface for Stable Diffusion AI models. |
11 | | -</div> |
12 | | - |
13 | | -## Model |
| 7 | +Built upon the Stable Diffusion WebUI, this worker provides an API to generate images with Stable Diffusion models. |
14 | 8 |
|
15 | | -The worker uses the Stable Diffusion model, which has been optimized for RunPod. This model is stored as a SafeTensors file, which is a format that facilitates efficient loading and execution of AI models. You may download the model file from the following link: here. |
| 9 | +</div> |
16 | 10 |
|
17 | | -## Building the Worker |
| 11 | +## Features |
18 | 12 |
|
19 | | -The worker is built using a Dockerfile. The Dockerfile specifies the base image, environment variables, system package dependencies, Python dependencies, and the steps to install and setup the Stable Diffusion WebUI. It also downloads the model and sets up the API server using supervisor. |
| 13 | +- Runs the [Automatic1111 Stable Diffusion WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) and exposes its txt2img API endpoint. |
| 14 | +- Comes pre-packaged with the [**Deliberate v6**](https://huggingface.co/XpucT/Deliberate) model (`Deliberate_v6.safetensors`). |
20 | 15 |
|
21 | | -The Python dependencies are specified in requirements.txt. The primary dependency is runpod==0.9.4. |
| 16 | +## Usage |
22 | 17 |
|
23 | | -## Running the Worker |
| 18 | +The `input` object within your job request is forwarded directly to the `/sdapi/v1/txt2img` endpoint of the internal Automatic1111 API. |
24 | 19 |
|
25 | | -The worker can be run using the start.sh script. This script starts the init system and runs the serverless handler script. |
| 20 | +### Configuration |
26 | 21 |
|
27 | | -## API |
| 22 | +The `input` object accepts any valid parameter for the Automatic1111 `/sdapi/v1/txt2img` endpoint. Refer to the [Automatic1111 API Documentation](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API) for a full list of available parameters (like `seed`, `sampler_name`, `batch_size`, `styles`, `override_settings`, etc.). |
28 | 23 |
|
29 | | -The worker provides an API for inference. The API is set up using supervisor, and the configuration is specified in webui_api.conf. The API runs on port 3000. |
| 24 | +### Example Request |
30 | 25 |
|
31 | | -## Serverless Handler |
| 26 | +Here's an example payload to generate an image: |
32 | 27 |
|
33 | | -The serverless handler (handler.py) is a Python script that handles inference requests. It defines a function handler(event) that takes an inference request, runs the inference using the Stable Diffusion model, and returns the output. |
| 28 | +```json |
| 29 | +{ |
| 30 | + "input": { |
| 31 | + "prompt": "a photograph of an astronaut riding a horse", |
| 32 | + "negative_prompt": "text, watermark, blurry, low quality", |
| 33 | + "steps": 25, |
| 34 | + "cfg_scale": 7, |
| 35 | + "width": 512, |
| 36 | + "height": 512, |
| 37 | + "sampler_name": "DPM++ 2M Karras" |
| 38 | + } |
| 39 | +} |
| 40 | +``` |
0 commit comments