Skip to content

Commit

Permalink
use localstorage comfy and models
Browse files Browse the repository at this point in the history
  • Loading branch information
MindSetVision committed Dec 26, 2024
1 parent eb6b61c commit f6eee84
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
32 changes: 16 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*


# Clone ComfyUI and custom nodes
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /ComfyUI && \
cd /ComfyUI/custom_nodes && \
git clone https://github.com/jags111/efficiency-nodes-comfyui && \
git clone https://github.com/nonnonstop/comfyui-faster-loading.git && \
git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git && \
git clone https://github.com/liusida/ComfyUI-AutoCropFaces.git && \
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack.git && \
git clone https://github.com/cubiq/ComfyUI_essentials.git && \
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
# RUN git clone https://github.com/comfyanonymous/ComfyUI.git /ComfyUI && \
# cd /ComfyUI/custom_nodes && \
# git clone https://github.com/jags111/efficiency-nodes-comfyui && \
# git clone https://github.com/nonnonstop/comfyui-faster-loading.git && \
# git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git && \
# git clone https://github.com/liusida/ComfyUI-AutoCropFaces.git && \
# git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack.git && \
# git clone https://github.com/cubiq/ComfyUI_essentials.git && \
# git clone https://github.com/ltdrdata/ComfyUI-Manager.git

# Install ComfyUI dependencies
RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 && \
pip3 install --no-cache-dir -r /ComfyUI/requirements.txt

# Install additional dependencies
RUN pip3 install --no-cache-dir runpod requests
ADD src/extra_model_paths.yaml /ComfyUI
# ADD src/extra_model_paths.yaml /ComfyUI
# Add start scripts and handler
ADD src/start.sh src/rp_handler.py /
RUN chmod +x /start.sh
Expand Down Expand Up @@ -62,14 +62,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Run manual installation script for Impact Pack
WORKDIR /ComfyUI/custom_nodes/ComfyUI-Impact-Pack
RUN python3 install-manual.py
# WORKDIR /ComfyUI/custom_nodes/ComfyUI-Impact-Pack
# RUN python3 install-manual.py

# Download and extract buffalo_l.zip
RUN mkdir -p /ComfyUI/models/insightface/models/buffalo_l && \
wget -q -O /tmp/buffalo_l.zip https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip && \
python3 -c "import zipfile; zip_ref = zipfile.ZipFile('/tmp/buffalo_l.zip', 'r'); zip_ref.extractall('/ComfyUI/models/insightface/models/buffalo_l'); zip_ref.close()" && \
rm -rf /tmp/buffalo_l.zip
# RUN mkdir -p /ComfyUI/models/insightface/models/buffalo_l && \
# wget -q -O /tmp/buffalo_l.zip https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip && \
# python3 -c "import zipfile; zip_ref = zipfile.ZipFile('/tmp/buffalo_l.zip', 'r'); zip_ref.extractall('/ComfyUI/models/insightface/models/buffalo_l'); zip_ref.close()" && \
# rm -rf /tmp/buffalo_l.zip

# Download other models using get_models.sh
# COPY src/get_models.sh /get_models.sh
Expand Down
4 changes: 3 additions & 1 deletion src/rp_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ def process_output_images(outputs, job_id):
"""

# The path where ComfyUI stores the generated images
COMFY_OUTPUT_PATH = os.environ.get("COMFY_OUTPUT_PATH", "/ComfyUI/output")
COMFY_OUTPUT_PATH = os.environ.get(
"COMFY_OUTPUT_PATH", "/runpod-volume/ComfyUI/output"
)

output_images = []

Expand Down
2 changes: 1 addition & 1 deletion src/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if [ "$SERVE_API_LOCALLY" == "true" ]; then
python3 -u /rp_handler.py --rp_serve_api --rp_api_host=0.0.0.0
else
echo "runpod-worker-comfy: Starting ComfyUI"
python3 runpod-volume/ComfyUI/main.py --disable-auto-launch --disable-metadata &
# python3 /ComfyUI/main.py --disable-auto-launch --disable-metadata &
python3 /ComfyUI/main.py --disable-auto-launch --disable-metadata &
echo "runpod-worker-comfy: Starting RunPod Handler"
python3 -u /rp_handler.py
fi

0 comments on commit f6eee84

Please sign in to comment.