forked from camenduru/flux.1-dev-lora-tost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use runpod/base to enable runpodctl during development
- Loading branch information
1 parent
2af87ba
commit 88c059c
Showing
1 changed file
with
26 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
FROM runpod/pytorch:2.2.1-py3.10-cuda12.1.1-devel-ubuntu22.04 | ||
# Use RunPod's base image | ||
FROM runpod/base:0.6.1-cuda12.2.0 | ||
|
||
# Set working directory | ||
WORKDIR /content | ||
|
||
# Update PATH | ||
ENV PATH="/home/camenduru/.local/bin:${PATH}" | ||
# Set custom working directory for your code | ||
WORKDIR /content/ComfyUI | ||
|
||
# Add and configure the 'camenduru' user | ||
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 | ||
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 && \ | ||
apt-get update && apt-get install -y aria2 git git-lfs unzip ffmpeg | ||
|
||
# Switch to the 'camenduru' user | ||
USER camenduru | ||
|
||
# Install Python dependencies | ||
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 | ||
# Install necessary Python dependencies | ||
RUN pip install --no-cache-dir 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 | ||
|
||
# Clone the ComfyUI repository | ||
RUN git clone https://github.com/comfyanonymous/ComfyUI /content/ComfyUI | ||
|
||
# Download and place the UNet model | ||
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 | ||
|
||
# Download and place the CLIP models | ||
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 | ||
|
||
# Download and place the VAE model | ||
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 | ||
|
||
# Download and place the LoRa model | ||
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 | ||
|
||
# Copy the worker script into the container | ||
COPY ./worker_runpod.py /content/ComfyUI/worker_runpod.py | ||
|
||
# Set working directory to ComfyUI | ||
WORKDIR /content/ComfyUI | ||
|
||
# Define the command to run the worker | ||
CMD ["python", "worker_runpod.py"] | ||
# Download required model files | ||
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 && \ | ||
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 && \ | ||
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 && \ | ||
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 | ||
|
||
# Reset the working directory to where the original start.sh is located | ||
WORKDIR / |