Spaces:
Running
Running
Download Dockerfile.basic from R1000/ComfyUI-CPU: direct link, hf CLI and curl.
- Browser
- Download file 10.2 kB
-
https://huggingface.co/spaces/R1000/ComfyUI-CPU/resolve/refs%2Fpr%2F2/Dockerfile.basic
- Command line
-
hf download hf://spaces/R1000/ComfyUI-CPU@refs/pr/2/Dockerfile.basic
-
curl -L -o Dockerfile.basic https://huggingface.co/spaces/R1000/ComfyUI-CPU/resolve/refs%2Fpr%2F2/Dockerfile.basic
10.2 kB
| FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| TZ=America/Los_Angeles | |
| ARG USE_PERSISTENT_DATA | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| make build-essential libssl-dev zlib1g-dev aria2 \ | |
| libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ | |
| libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git-lfs \ | |
| ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && git lfs install | |
| WORKDIR /code | |
| COPY ./requirements.txt /code/requirements.txt | |
| # User | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Pyenv | |
| RUN curl https://pyenv.run | bash | |
| ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH | |
| ARG PYTHON_VERSION=3.10 | |
| # Python | |
| RUN pyenv install $PYTHON_VERSION && \ | |
| pyenv global $PYTHON_VERSION && \ | |
| pyenv rehash && \ | |
| pip install --no-cache-dir --upgrade pip setuptools wheel && \ | |
| pip install --no-cache-dir \ | |
| datasets \ | |
| huggingface-hub "protobuf<4" "click<8.1" && \ | |
| pip install scikit-image && \ | |
| pip install numba && \ | |
| pip install dynamicprompts && \ | |
| pip install diffusers | |
| #pip install huggingface_hub["cli"] && \ | |
| #huggingface-cli delete-cache | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app | |
| WORKDIR $HOME/app | |
| # Clone the ComfyUI repo (fork with restart button) | |
| # ARG CACHEBUST=1 | |
| # RUN git clone https://github.com/comfyanonymous/ComfyUI.git . && \ | |
| # pip install --no-cache-dir -r requirements.txt | |
| # Clone the ComfyUI repo และล็อกเวอร์ชันที่ v0.28.0 | |
| RUN git clone https://github.com/comfyanonymous/ComfyUI.git . && \ | |
| git checkout v0.28.0 && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Checkpoints | |
| RUN echo "Downloading checkpoints..." | |
| #ADD --chown=user https://huggingface.co/mhnakif/flux-hyp8/resolve/main/flux-hyp8-Q8_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/city96/FLUX.1-dev-gguf/resolve/main/flux1-dev-Q8_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/city96/Qwen-Image-gguf/resolve/main/qwen-image-Q4_K_M.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/unsloth/Z-Image-Turbo-GGUF/resolve/main/z-image-turbo-Q8_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/unsloth/Z-Image-GGUF/resolve/main/z-image-Q8_0.gguf ./models/unet/ | |
| ADD --chown=user https://huggingface.co/unsloth/FLUX.2-klein-4B-GGUF/resolve/main/flux-2-klein-4b-Q8_0.gguf ./models/unet/ | |
| ADD --chown=user https://huggingface.co/unsloth/FLUX.2-klein-9B-GGUF/resolve/main/flux-2-klein-9b-Q8_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/T5B/Z-Image-Turbo-FP8/resolve/main/z-image-turbo-fp8-e4m3fn.safetensors ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/Wednesday-Hargreeves/flux-dev-fp8/resolve/main/flux1-dev-fp8.safetensors ./models/checkpoints/ | |
| #ADD --chown=user https://huggingface.co/Comfy-Org/ACE-Step_ComfyUI_repackaged/resolve/main/all_in_one/ace_step_v1_3.5b.safetensors ./models/checkpoints/ | |
| #ADD --chown=user https://huggingface.co/QuantStack/FLUX.1-Krea-dev-GGUF/resolve/main/flux1-krea-dev-Q8_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/city96/FLUX.1-dev-gguf/resolve/main/flux1-dev-Q5_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/bullerwins/FLUX.1-Kontext-dev-GGUF/resolve/main/flux1-kontext-dev-Q8_0.gguf ./models/unet/ | |
| #ADD --chown=user https://huggingface.co/zer0int/CLIP-GmP-ViT-L-14/resolve/main/ViT-L-14-TEXT-detail-improved-hiT-GmP-TE-only-HF.safetensors ./models/clip/ | |
| #ADD --chown=user https://huggingface.co/city96/t5-v1_1-xxl-encoder-gguf/resolve/main/t5-v1_1-xxl-encoder-Q8_0.gguf ./models/clip/ | |
| ADD --chown=user https://huggingface.co/unsloth/Qwen3-4B-GGUF/resolve/main/Qwen3-4B-Q8_0.gguf ./models/clip/ | |
| #ADD --chown=user https://huggingface.co/Cordux/flux2-klein-4B-uncensored-text-encoder/resolve/main/qwen3-4b-abl-q4_0.gguf ./models/unet/ | |
| ADD --chown=user https://huggingface.co/Mungert/Qwen3-8B-abliterated-GGUF/resolve/main/Qwen3-8B-abliterated-q8_0.gguf ./models/text_encoders/ | |
| #ADD --chown=user https://huggingface.co/ponpoke/flux2-klein-9b-uncensored-text-encoder/resolve/main/flux2-klein-9b-uncensored-q8_0.gguf ./models/text_encoders/ | |
| ADD --chown=user https://huggingface.co/Comfy-Org/z_image_turbo/resolve/main/split_files/text_encoders/qwen_3_4b_fp4_mixed.safetensors ./models/text_encoders/ | |
| ADD --chown=user https://huggingface.co/unsloth/Qwen3-8B-GGUF/resolve/main/Qwen3-8B-Q8_0.gguf ./models/text_encoders/ | |
| #ADD --chown=user https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors ./models/vae/ | |
| ADD --chown=user https://huggingface.co/receptektas/black-forest-labs-ae_safetensors/resolve/main/ae.safetensors ./models/vae/ | |
| ADD --chown=user https://huggingface.co/Owen777/UltraFlux-v1/resolve/main/vae/diffusion_pytorch_model.safetensors ./models/vae/Ultra-Flux-V1.safetensors | |
| ADD --chown=user https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors ./models/vae/ | |
| #ADD --chown=user https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/vae/qwen_image_vae.safetensors ./models/vae/ | |
| #RUN wget -c https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors -P ./models/vae/ | |
| ADD --chown=user https://huggingface.co/prithivMLmods/Canopus-LoRA-Flux-UltraRealism-2.0/resolve/main/Canopus-LoRA-Flux-UltraRealism.safetensors ./models/loras/Flux-UltraRealism.safetensors | |
| ADD --chown=user https://huggingface.co/akash-guptag/NSFW-Flux-Lora/resolve/main/aidmaNSFWunlock-FLUX-V0.2.safetensors ./models/loras/ | |
| ADD --chown=user https://huggingface.co/camenduru/FLUX.1-dev/resolve/fc63f3204a12362f98c04bc4c981a06eb9123eee/FLUX.1-Turbo-Alpha.safetensors ./models/loras/FLUX.1-Turbo-Alpha.safetensors | |
| #RUN wget -q https://civitai.com/api/download/models/2510875 -O ./models/loras/breast.safetensors | |
| ADD --chown=user https://huggingface.co/latent-consistency/lcm-lora-sdxl/resolve/main/pytorch_lora_weights.safetensors ./models/loras/lcm-sdxl.safetensors | |
| ADD --chown=user https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart.pth ./models/controlnet/ | |
| ADD --chown=user https://huggingface.co/Hex820000/anime_v10/resolve/main/anime_v10.safetensors ./models/checkpoints/ | |
| ADD --chown=user https://huggingface.co/SG161222/RealVisXL_V5.0_Lightning/resolve/main/RealVisXL_V5.0_Lightning_fp16.safetensors ./models/checkpoints/ | |
| ADD --chown=user https://huggingface.co/SG161222/Realistic_Vision_V6.0_B1_noVAE/resolve/main/Realistic_Vision_V6.0_NV_B1_fp16.safetensors ./models/checkpoints/ | |
| ADD --chown=user https://huggingface.co/IbarakiDouji/WAI-NSFW-illustrious-SDXL/resolve/main/waiIllustriousSDXL_v170.safetensors ./models/checkpoints/ | |
| ADD --chown=user https://huggingface.co/Lykon/dreamshaper-xl-v2-turbo/resolve/main/DreamShaperXL_Turbo_V2-SFW.safetensors ./models/checkpoints/ | |
| RUN wget -c https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P ./models/upscale_models/ | |
| RUN wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth -P ./models/upscale_models/ | |
| RUN wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x4.pth -P ./models/upscale_models/ | |
| RUN wget -c https://huggingface.co/Acly/Omni-SR/resolve/main/OmniSR_X2_DIV2K.safetensors -P ./models/upscale_models/ | |
| RUN wget -c https://huggingface.co/Acly/Omni-SR/resolve/main/OmniSR_X3_DIV2K.safetensors -P ./models/upscale_models/ | |
| RUN wget -c https://huggingface.co/Acly/Omni-SR/resolve/main/OmniSR_X4_DIV2K.safetensors -P ./models/upscale_models/ | |
| RUN echo "Done" | |
| # instal custom nodes | |
| RUN echo "Installing custom nodes..." | |
| # RUN cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Manager.git | |
| # ติดตั้ง ComfyUI-Manager และล็อกเวอร์ชัน | |
| RUN cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Manager.git && \ | |
| cd ComfyUI-Manager && git checkout v3.40 | |
| RUN cd custom_nodes && git clone https://github.com/crystian/ComfyUI-Crystools && cd ComfyUI-Crystools && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/rgthree/rgthree-comfy.git && cd rgthree-comfy && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts | |
| RUN cd custom_nodes && git clone https://github.com/welltop-cn/ComfyUI-TeaCache.git | |
| RUN cd custom_nodes && git clone https://github.com/ty0x2333/ComfyUI-Dev-Utils.git && cd ComfyUI-Dev-Utils && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/ssitu/ComfyUI_UltimateSDUpscale --recursive | |
| RUN cd custom_nodes && git clone https://github.com/chengzeyi/Comfy-WaveSpeed.git | |
| RUN cd custom_nodes && git clone https://github.com/city96/ComfyUI-GGUF && cd ComfyUI-GGUF && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/XLabs-AI/x-flux-comfyui && cd x-flux-comfyui && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes && cd ComfyUI-KJNodes && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/gseth/ControlAltAI-Nodes | |
| RUN cd custom_nodes && git clone https://github.com/Fannovel16/comfyui_controlnet_aux && cd comfyui_controlnet_aux && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet | |
| RUN cd custom_nodes && git clone https://github.com/willmiao/ComfyUI-Lora-Manager && cd ComfyUI-Lora-Manager && pip install -r requirements.txt | |
| RUN cd custom_nodes && git clone https://github.com/kijai/ComfyUI-Florence2.git | |
| RUN wget -c https://huggingface.co/ljnlonoljpiljm/florence-2-base-nsfw-v2/resolve/main/model.safetensors -P ./models/llm/Florence-2-base-ft/ | |
| RUN echo "Done" | |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| CMD ["python", "main.py", "--cpu", "--listen", "0.0.0.0", "--port", "7860", "--output-directory", "${USE_PERSISTENT_DATA:+/data/}"] |