Nodiw52992 commited on
Commit
0548bd3
·
verified ·
1 Parent(s): 907fe4e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -12
Dockerfile CHANGED
@@ -1,36 +1,32 @@
1
- # Dockerfile
2
  FROM ubuntu:24.04
3
 
 
 
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
- # Install essentials
7
  RUN apt-get update && apt-get install -y \
8
  python3 python3-venv python3-pip git wget \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  WORKDIR /workspace
12
 
13
- # Clone ComfyUI
14
  RUN git clone https://github.com/comfyanonymous/ComfyUI.git
15
-
16
  WORKDIR /workspace/ComfyUI
17
 
18
- # Set up Python venv & install
19
  RUN python3 -m venv .venv \
20
  && . .venv/bin/activate \
21
  && pip install --upgrade pip \
22
  && pip install xformers!=0.0.18 \
23
  && pip install -r requirements.txt
24
 
25
- # Download Flux.1 Schnell UNET & VAE
26
  RUN mkdir -p models/unet models/vae \
27
- && wget -c https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/flux1-schnell.safetensors \
28
- -P models/unet/ \
29
- && wget -c https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors \
30
- -P models/vae/
 
 
31
 
32
- # Expose ComfyUI port
33
  EXPOSE 7860
34
 
35
- # Launch script
36
  CMD ["/bin/bash", "-lc", "source .venv/bin/activate && python3 main.py --host 0.0.0.0 --port 7860 --cpu"]
 
 
1
  FROM ubuntu:24.04
2
 
3
+ ARG HF_TOKEN
4
+ ENV HF_TOKEN=${HF_TOKEN}
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
 
7
  RUN apt-get update && apt-get install -y \
8
  python3 python3-venv python3-pip git wget \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  WORKDIR /workspace
12
 
 
13
  RUN git clone https://github.com/comfyanonymous/ComfyUI.git
 
14
  WORKDIR /workspace/ComfyUI
15
 
 
16
  RUN python3 -m venv .venv \
17
  && . .venv/bin/activate \
18
  && pip install --upgrade pip \
19
  && pip install xformers!=0.0.18 \
20
  && pip install -r requirements.txt
21
 
 
22
  RUN mkdir -p models/unet models/vae \
23
+ && wget --header="Authorization: Bearer ${HF_TOKEN}" \
24
+ https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/flux1-schnell.safetensors \
25
+ -O models/unet/flux1-schnell.safetensors \
26
+ && wget --header="Authorization: Bearer ${HF_TOKEN}" \
27
+ https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors \
28
+ -O models/vae/ae.safetensors
29
 
 
30
  EXPOSE 7860
31
 
 
32
  CMD ["/bin/bash", "-lc", "source .venv/bin/activate && python3 main.py --host 0.0.0.0 --port 7860 --cpu"]