Update Dockerfile
Browse files9 unmodified lines101112131415161718192021222324252627282930313233343536373839404142434445469 unmodified linesRUN git clone https://github.com/comfyanonymous/ComfyUI.gitWORKDIR /workspace/ComfyUI# Install dependencies including huggingface_hubRUN python3 -m venv .venv \&& . .venv/bin/activate \&& pip install --upgrade pip \&& pip install huggingface_hub xformers!=0.0.18 \&& pip install -r requirements.txt# Download model files securely using hf_hub_downloadRUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \. .venv/bin/activate && \python3 - << 'EOF'import osfrom huggingface_hub import hf_hub_downloadhf = open('/run/secrets/HF_TOKEN').read().strip()# UNEThf_hub_download(repo_id="black-forest-labs/FLUX.1-schnell",filename="flux1-schnell.safetensors",token=hf,local_dir="models/unet",force_download=True)# VAEhf_hub_download(repo_id="black-forest-labs/FLUX.1-schnell",filename="ae.safetensors",token=hf,local_dir="models/vae",force_download=True)EOFEXPOSE 78609 unmodified lines101112131415161718192021222324252627289 unmodified linesRUN git clone https://github.com/comfyanonymous/ComfyUI.gitWORKDIR /workspace/ComfyUIRUN python3 -m venv .venv \&& . .venv/bin/activate \&& pip install --upgrade pip \&& pip install huggingface_hub xformers!=0.0.18 \&& pip install -r requirements.txt# Copy download scriptCOPY download_flux.py /workspace/ComfyUI/download_flux.py# Use secret to download model files via huggingface_hubRUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \. .venv/bin/activate && \python download_flux.pyEXPOSE 7860
Dockerfile+5-23