Standalone model server for Stable Diffusion Image Generation task
1.8K
https://huggingface.co/stabilityai/stable-diffusion-2
needs to be run on a machine with:
For testing, I used an AWS EC2 g5.2xlarge, configured with AMI
Deep Learning AMI GPU PyTorch 2.0.0 (Amazon Linux 2) 20230524
(
ami-0fbe8400aab4b8214 (64-bit (x86))),
and installed Docker + nvidia-container-toolkit by following this guide (click me, I'm a link)
docker run --gpus all -p 4567:8080 michalautumn8/stable-diffusion-fp16-gpu-only
curl -X POST http://localhost:4567/v1/models/autodl:predict \
-H "Content-Type: application/json" \
-d '"a photo of an astronaut riding a horse on mars"'
Returns a 1MB base64-encoded string, which, after conversion - in our example - corresponds to the following image:

Content type
Image
Digest
sha256:71cde0870…
Size
8.2 GB
Last updated
over 3 years ago
docker pull michalautumn8/stable-diffusion-fp16-gpu-only