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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -16
Dockerfile CHANGED
@@ -1,31 +1,36 @@
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
 
 
1
  FROM ubuntu:24.04
2
 
3
+ # Build argument for your HF token (not persisted at runtime)
4
  ARG HF_TOKEN
5
  ENV HF_TOKEN=${HF_TOKEN}
6
  ENV DEBIAN_FRONTEND=noninteractive
7
 
8
+ RUN apt-get update && \
9
+ apt-get install -y python3 python3-venv python3-pip git wget && \
10
+ rm -rf /var/lib/apt/lists/*
11
 
12
  WORKDIR /workspace
13
 
14
+ # Clone ComfyUI
15
  RUN git clone https://github.com/comfyanonymous/ComfyUI.git
16
  WORKDIR /workspace/ComfyUI
17
 
18
+ # Setup virtual environment
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
+ # Authenticate and download model files
26
+ RUN mkdir -p models/unet models/vae && \
27
+ wget --header="Authorization: Bearer ${HF_TOKEN}" \
28
+ https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/flux1-schnell.safetensors \
29
+ -O models/unet/flux1-schnell.safetensors && \
30
+ wget --header="Authorization: Bearer ${HF_TOKEN}" \
31
+ https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors \
32
+ -O models/vae/ae.safetensors
33
+ # per Hugging Face guidance: use Bearer headers to download gated/private files :contentReference[oaicite:1]{index=1}
34
 
35
  EXPOSE 7860
36