rupeshs / fastsdcpu

Fast stable diffusion on CPU
MIT License
1.51k stars 123 forks source link

Is there docker support? #88

Open grigio opened 1 year ago

grigio commented 1 year ago

I'd like to test it with docker/docker-compose and webui

rupeshs commented 1 year ago

@grigio It is possible, but currently, there is no docker support. If you are interested feel free to create a PR.

Bornholm commented 5 months ago

@grigio FYI this Dockerfile should work (tested it rapidly this weekend):

FROM ubuntu:22.04

ARG FASTSDCPU_VERSION=v1.0.0-beta.33

RUN apt update && apt-get install -y python3 python3-venv python3-wheel ffmpeg git

RUN git clone https://github.com/rupeshs/fastsdcpu /app \
    && cd app \
    && git checkout -b $FASTSDCPU_VERSION

WORKDIR /app

SHELL ["/bin/bash", "-c"]

RUN echo y | bash -x ./install.sh --disable-gui

VOLUME /app/lora_models
VOLUME /app/controlnet_models
VOLUME /root/.cache/huggingface

ENV GRADIO_SERVER_NAME=0.0.0.0

EXPOSE 7860

CMD ["/app/start-webui.sh"]

Build it with:

docker build -t fastsdcpu:latest .

Then run it with:

docker run -it --rm -p 7860:7860 -v fastsdcpu_models:/app/lora_models -v fastsdcpu_controlnet_models:/app/controlnet_models fastsdcpu:latest

The Web UI should be accessible on http://localhost:7860