dimensionx-up / Dockerfile
camenduru's picture
Create Dockerfile
ddf6226 verified
FROM runpod/pytorch:2.2.1-py3.10-cuda12.1.1-devel-ubuntu22.04
WORKDIR /content
ENV PATH="/home/camenduru/.local/bin:${PATH}"
RUN adduser --disabled-password --gecos '' camenduru && \
adduser camenduru sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R camenduru:camenduru /content && \
chmod -R 777 /content && \
chown -R camenduru:camenduru /home && \
chmod -R 777 /home && \
apt update -y && add-apt-repository -y ppa:git-core/ppa && apt update -y && apt install -y aria2 git git-lfs unzip ffmpeg
USER camenduru
RUN pip install torch==2.5.0+cu124 torchvision==0.20.0+cu124 torchaudio==2.5.0+cu124 torchtext==0.18.0 torchdata==0.8.0 --extra-index-url https://download.pytorch.org/whl/cu124 && \
pip install xformers==0.0.28.post2 https://github.com/camenduru/wheels/releases/download/torch-2.5.0-cu124/flash_attn-2.6.3-cp310-cp310-linux_x86_64.whl && \
pip install opencv-python imageio imageio-ffmpeg ffmpeg-python av runpod && \
pip install torchsde einops diffusers transformers accelerate peft timm && \
git clone https://github.com/comfyanonymous/ComfyUI /content/ComfyUI && \
git clone https://github.com/ltdrdata/ComfyUI-Manager /content/ComfyUI/custom_nodes/ComfyUI-Manager && \
git clone https://github.com/kijai/ComfyUI-CogVideoXWrapper /content/ComfyUI/custom_nodes/ComfyUI-CogVideoXWrapper && \
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite /content/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite && \
git clone https://github.com/kijai/ComfyUI-KJNodes /content/ComfyUI/custom_nodes/ComfyUI-KJNodes && \
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 && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/DimensionX/resolve/main/orbit_left_lora_weights.safetensors -d /content/ComfyUI/models/CogVideo/loras -o orbit_left_lora_weights.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/DimensionX/resolve/main/orbit_up_lora_weights.safetensors -d /content/ComfyUI/models/CogVideo/loras -o orbit_up_lora_weights.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/scheduler/scheduler_config.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/scheduler -o scheduler_config.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/text_encoder/config.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/text_encoder -o config.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/text_encoder/model-00001-of-00002.safetensors -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/text_encoder -o model-00001-of-00002.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/text_encoder/model-00002-of-00002.safetensors -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/text_encoder -o model-00002-of-00002.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/text_encoder/model.safetensors.index.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/text_encoder -o model.safetensors.index.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/tokenizer/added_tokens.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/tokenizer -o added_tokens.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/tokenizer/special_tokens_map.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/tokenizer -o special_tokens_map.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/tokenizer/spiece.model -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/tokenizer -o spiece.model && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/tokenizer/tokenizer_config.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/tokenizer -o tokenizer_config.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/transformer/config.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/transformer -o config.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/transformer/diffusion_pytorch_model-00001-of-00003.safetensors -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/transformer -o diffusion_pytorch_model-00001-of-00003.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/transformer/diffusion_pytorch_model-00002-of-00003.safetensors -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/transformer -o diffusion_pytorch_model-00002-of-00003.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/transformer/diffusion_pytorch_model-00003-of-00003.safetensors -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/transformer -o diffusion_pytorch_model-00003-of-00003.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/transformer/diffusion_pytorch_model.safetensors.index.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/transformer -o diffusion_pytorch_model.safetensors.index.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/vae/config.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/vae -o config.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/resolve/main/vae/diffusion_pytorch_model.safetensors -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V/vae -o diffusion_pytorch_model.safetensors && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/configuration.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V -o configuration.json && \
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/vdo/CogVideoX-5b-I2V/raw/main/model_index.json -d /content/ComfyUI/models/CogVideo/CogVideoX-5b-I2V -o model_index.json
COPY ./worker_runpod.py /content/ComfyUI/worker_runpod.py
WORKDIR /content/ComfyUI
CMD python worker_runpod.py