Sign inSign up

michalautumn8/stable-diffusion-fp16-gpu-only

By michalautumn8

•Updated over 3 years ago

Standalone model server for Stable Diffusion Image Generation task

Image
0

1.8K

michalautumn8/stable-diffusion-fp16-gpu-only repository overview

https://huggingface.co/stabilityai/stable-diffusion-2⁠

⁠Usage:

⁠Prerequisites

needs to be run on a machine with:

  • an NVIDIA GPU available,
  • CUDA drivers installed,
  • nvidia-container-toolkit installed

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)⁠

⁠Startup:

docker run --gpus all -p 4567:8080 michalautumn8/stable-diffusion-fp16-gpu-only

⁠Request:
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"'
⁠Response:

Returns a 1MB base64-encoded string, which, after conversion - in our example - corresponds to the following image: a photo of an astronaut riding a horse on mars

⁠Shortcomings

  • does not support batch IO
    • that should be simple to fix by editing the handler file included in the image

Tag summary

Content type

Image

Digest

sha256:71cde0870…

Size

8.2 GB

Last updated

over 3 years ago

docker pull michalautumn8/stable-diffusion-fp16-gpu-only