From a1675fa5997905637e5ec500fd2e74965118d16e Mon Sep 17 00:00:00 2001 From: Bryce Date: Wed, 14 Sep 2022 21:24:16 -0700 Subject: [PATCH] docs: add dockerfile example --- Dockerfile | 10 ++++++++++ README.md | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e40e653 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.10.6-slim + +RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 + +ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_ROOT_USER_ACTION=ignore + +RUN pip install imaginairy + +#RUN #imagine pizza \ No newline at end of file diff --git a/README.md b/README.md index 3693fc0..48ec214 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,14 @@ imagine_image_files(prompts, outdir="./my-art") - ~10 gb space for models to download - A decent computer with either a CUDA supported graphics card or M1 processor. +## Running in Docker +See example Dockerfile (works on machine where you can pass the gpu into the container) +```bash +docker build . -t imaginairy +# you really want to map the cache or you end up wasting a lot of time and space redownloading the model weights +docker run -it --gpus all -v $HOME/.cache/huggingface:/root/.cache/huggingface -v $HOME/.cache/torch:/root/.cache/torch -v `pwd`/outputs:/outputs imaginairy /bin/bash +``` + ## Improvements from CompVis - img2img actually does # of steps you specify - performance optimizations