Skip to content

Commit

Permalink
Add changes from alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
cyntachs committed Aug 12, 2023
1 parent 01f2149 commit 52d8aa3
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
FROM pytorch/pytorch:latest

ENV NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
RUN apt update && apt install git python3-pip -y && apt clean

RUN apt update && apt install git python3-pip libsm6 libxext6 -y && apt clean
RUN mkdir /docker
COPY . /docker/
RUN chmod u+x /docker/entrypoint.sh

ENV ROOT=/stable-diffusion
RUN git clone https://github.com/comfyanonymous/ComfyUI.git ${ROOT} && \
cd ${ROOT} && \
pip install -r requirements.txt

WORKDIR ${ROOT}

RUN cd ./custom_nodes && \
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
RUN mkdir ${ROOT}

ENV NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
EXPOSE 5555
CMD python -u main.py --listen --port 5555 ${CLI_ARGS}
ENTRYPOINT [ "sh" , "/docker/entrypoint.sh" ]
WORKDIR ${ROOT}
RUN python -u main.py --listen --port 5555 ${CLI_ARGS}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ services:
ports:
- ${PORT}:5555
volumes:
- ${VOLUME}:/stable-diffusion
- ${COMFY_VOLUME}:/stable-diffusion
environment:
- CLI_ARGS=
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
device_ids: ['0']
capabilities: [compute, utility]
27 changes: 27 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

cd /

if [ ! -f "/stable-diffusion/.installed" ]; then
echo "Installing ComfyUI..."
git clone https://github.com/comfyanonymous/ComfyUI.git /stable-diffusion
cd /stable-diffusion
pip install -r requirements.txt

cd /stable-diffusion/custom_nodes

echo "Installing ComfyUI Manager..."
git clone https://github.com/ltdrdata/ComfyUI-Manager.git

cd /

touch /stable-diffusion/.installed
else
echo "Updating ComfyUI..."
cd /stable-diffusion

git fetch https://github.com/comfyanonymous/ComfyUI.git
git pull
fi;

echo "Starting ComfyUI..."

0 comments on commit 52d8aa3

Please sign in to comment.