|
1 | 1 | FROM runpod/pytorch:2.2.1-py3.10-cuda12.1.1-devel-ubuntu22.04
|
| 2 | + |
| 3 | +# Set working directory |
2 | 4 | WORKDIR /content
|
| 5 | + |
| 6 | +# Update PATH |
3 | 7 | ENV PATH="/home/camenduru/.local/bin:${PATH}"
|
4 | 8 |
|
5 | 9 | # Add and configure the 'camenduru' user
|
6 |
| -RUN adduser --disabled-password --gecos '' camenduru && \ |
7 |
| - adduser camenduru sudo && \ |
8 |
| - echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ |
9 |
| - chown -R camenduru:camenduru /content && \ |
10 |
| - chmod -R 755 /content && \ |
11 |
| - chown -R camenduru:camenduru /home && \ |
12 |
| - chmod -R 755 /home && \ |
13 |
| - apt update -y && \ |
14 |
| - add-apt-repository -y ppa:git-core/ppa && \ |
15 |
| - apt update -y && \ |
16 |
| - apt install -y aria2 git git-lfs unzip ffmpeg |
| 10 | +RUN adduser --disabled-password --gecos '' camenduru && adduser camenduru sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && chown -R camenduru:camenduru /content && chmod -R 755 /content && chown -R camenduru:camenduru /home && chmod -R 755 /home && apt update -y && add-apt-repository -y ppa:git-core/ppa && apt update -y && apt install -y aria2 git git-lfs unzip ffmpeg |
17 | 11 |
|
| 12 | +# Switch to the 'camenduru' user |
18 | 13 | USER camenduru
|
19 | 14 |
|
20 | 15 | # Install Python dependencies
|
21 |
| -RUN pip install -q opencv-python imageio imageio-ffmpeg ffmpeg-python av runpod \ |
22 |
| - xformers==0.0.25 torchsde==0.2.6 einops==0.8.0 diffusers==0.28.0 transformers==4.41.2 accelerate==0.30.1 |
| 16 | +RUN pip install -q opencv-python imageio imageio-ffmpeg ffmpeg-python av runpod xformers==0.0.25 torchsde==0.2.6 einops==0.8.0 diffusers==0.28.0 transformers==4.41.2 accelerate==0.30.1 |
23 | 17 |
|
24 | 18 | # Clone the ComfyUI repository
|
25 | 19 | RUN git clone https://github.com/comfyanonymous/ComfyUI /content/ComfyUI
|
26 | 20 |
|
27 | 21 | # Download and place the UNet model
|
28 |
| -RUN mkdir -p /content/ComfyUI/models/unet && \ |
29 |
| - aria2c --console-log-level=error -c -x 16 -s 16 -k 1M \ |
30 |
| - https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/flux1-dev.sft \ |
31 |
| - -d /content/ComfyUI/models/unet -o flux1-dev.sft |
| 22 | +RUN mkdir -p /content/ComfyUI/models/unet && aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/flux1-dev.sft" -d /content/ComfyUI/models/unet -o flux1-dev.sft |
32 | 23 |
|
33 | 24 | # Download and place the CLIP models
|
34 |
| -RUN mkdir -p /content/ComfyUI/models/clip && \ |
35 |
| - aria2c --console-log-level=error -c -x 16 -s 16 -k 1M \ |
36 |
| - https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/clip_l.safetensors \ |
37 |
| - -d /content/ComfyUI/models/clip -o clip_l.safetensors && \ |
38 |
| - aria2c --console-log-level=error -c -x 16 -s 16 -k 1M \ |
39 |
| - https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/t5xxl_fp16.safetensors \ |
40 |
| - -d /content/ComfyUI/models/clip -o t5xxl_fp16.safetensors |
| 25 | +RUN mkdir -p /content/ComfyUI/models/clip && aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/clip_l.safetensors" -d /content/ComfyUI/models/clip -o clip_l.safetensors && aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/t5xxl_fp16.safetensors" -d /content/ComfyUI/models/clip -o t5xxl_fp16.safetensors |
41 | 26 |
|
42 | 27 | # Download and place the VAE model
|
43 |
| -RUN mkdir -p /content/ComfyUI/models/vae && \ |
44 |
| - aria2c --console-log-level=error -c -x 16 -s 16 -k 1M \ |
45 |
| - https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/ae.sft \ |
46 |
| - -d /content/ComfyUI/models/vae -o ae.sft |
| 28 | +RUN mkdir -p /content/ComfyUI/models/vae && aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://huggingface.co/camenduru/FLUX.1-dev/resolve/main/ae.sft" -d /content/ComfyUI/models/vae -o ae.sft |
47 | 29 |
|
48 | 30 | # Download and place the LoRa model
|
49 |
| -RUN mkdir -p /content/ComfyUI/models/loras && \ |
50 |
| - aria2c --console-log-level=error -c -x 16 -s 16 -k 1M \ |
51 |
| - https://civitai.com/api/download/models/896422?type=Model&format=SafeTensor \ |
52 |
| - -d /content/ComfyUI/models/loras -o zanshou-kin-flux-ueno-manga-style.safetensors |
| 31 | +RUN mkdir -p /content/ComfyUI/models/loras && aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/896422?type=Model&format=SafeTensor" -d /content/ComfyUI/models/loras -o zanshou-kin-flux-ueno-manga-style.safetensors |
53 | 32 |
|
54 | 33 | # Copy the worker script into the container
|
55 | 34 | COPY ./worker_runpod.py /content/ComfyUI/worker_runpod.py
|
56 | 35 |
|
| 36 | +# Set working directory to ComfyUI |
57 | 37 | WORKDIR /content/ComfyUI
|
58 | 38 |
|
59 | 39 | # Define the command to run the worker
|
60 |
| -CMD python worker_runpod.py |
| 40 | +CMD ["python", "worker_runpod.py"] |
0 commit comments