Spaces:
Runtime error
Runtime error
FROM ubuntu:22.04 | |
# 必要なパッケージをインストール | |
RUN apt-get update && apt-get install -y \ | |
git wget python3 python3-pip && \ | |
apt-get clean && rm -rf /var/lib/apt/lists/* | |
# Pythonのデフォルト実行ファイルをpython3に変更 | |
RUN ln -s /usr/bin/python3 /usr/bin/python | |
# Hugging Face APIトークンを環境変数として設定 | |
ARG HF_TOKEN | |
ENV HF_TOKEN=${HF_TOKEN} | |
# リポジトリをクローン | |
WORKDIR / | |
RUN git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git | |
# 必要なモデルをダウンロード | |
WORKDIR /stable-diffusion-webui-forge/models/text_encoder | |
RUN wget --header="Authorization: Bearer ${HF_TOKEN}" \ | |
https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors \ | |
https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/text_encoder/model.fp16.safetensors \ | |
https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/text_encoder/model.safetensors \ | |
https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors | |
RUN mkdir -p /stable-diffusion-webui-forge/models/clip/ | |
WORKDIR /stable-diffusion-webui-forge/models/clip/ | |
RUN wget --header="Authorization: Bearer ${HF_TOKEN}" \ | |
"https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors" \ | |
"https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/model.safetensors" | |
WORKDIR /stable-diffusion-webui-forge/models/Stable-diffusion | |
RUN wget --header="Authorization: Bearer ${HF_TOKEN}" \ | |
https://huggingface.co/stabilityai/stable-diffusion-3.5-large/resolve/main/sd3.5_large.safetensors \ | |
https://huggingface.co/lllyasviel/flux1-dev-bnb-nf4/resolve/main/flux1-dev-bnb-nf4-v2.safetensors | |
# WebUIの起動(CPUモード) | |
WORKDIR /stable-diffusion-webui-forge | |
CMD ["python3", "launch.py", "--share", "--disable-torch-cuda"] | |