Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +40 -0
Dockerfile
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
|
2 |
+
|
3 |
+
# 必要なパッケージをインストール
|
4 |
+
RUN apt-get update && apt-get install -y \
|
5 |
+
git wget python3 python3-pip && \
|
6 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
7 |
+
|
8 |
+
# Pythonのデフォルト実行ファイルをpython3に変更
|
9 |
+
RUN ln -s /usr/bin/python3 /usr/bin/python
|
10 |
+
|
11 |
+
# Hugging Face APIトークンを環境変数として設定
|
12 |
+
ARG HF_TOKEN
|
13 |
+
ENV HF_TOKEN=${HF_TOKEN}
|
14 |
+
|
15 |
+
# リポジトリをクローン
|
16 |
+
WORKDIR /
|
17 |
+
RUN git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git
|
18 |
+
|
19 |
+
# 必要なモデルをダウンロード
|
20 |
+
WORKDIR /stable-diffusion-webui-forge/models/text_encoder
|
21 |
+
RUN wget --header="Authorization: Bearer ${HF_TOKEN}" \
|
22 |
+
https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors \
|
23 |
+
https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/text_encoder/model.fp16.safetensors \
|
24 |
+
https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/text_encoder/model.safetensors \
|
25 |
+
https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
|
26 |
+
|
27 |
+
RUN mkdir -p /stable-diffusion-webui-forge/models/clip/
|
28 |
+
WORKDIR /stable-diffusion-webui-forge/models/clip/
|
29 |
+
RUN wget --header="Authorization: Bearer ${HF_TOKEN}" \
|
30 |
+
"https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors" \
|
31 |
+
"https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/model.safetensors"
|
32 |
+
|
33 |
+
WORKDIR /stable-diffusion-webui-forge/models/Stable-diffusion
|
34 |
+
RUN wget --header="Authorization: Bearer ${HF_TOKEN}" \
|
35 |
+
https://huggingface.co/stabilityai/stable-diffusion-3.5-large/resolve/main/sd3.5_large.safetensors \
|
36 |
+
https://huggingface.co/lllyasviel/flux1-dev-bnb-nf4/resolve/main/flux1-dev-bnb-nf4-v2.safetensors
|
37 |
+
|
38 |
+
# WebUIの起動
|
39 |
+
WORKDIR /stable-diffusion-webui-forge
|
40 |
+
CMD ["python3", "launch.py", "--share"]
|