rootuc commited on
Commit ·
6bf55b4
1
Parent(s): 0198a09
update
Browse files
Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 使用支持 CUDA 的基础镜像(如果要在 CPU 运行,基础镜像也通用)
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# 设置工作目录
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 安装系统依赖
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
libgl1-mesa-glx \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
+
wget \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# 克隆 ComfyUI 源码
|
| 16 |
+
RUN git clone https://github.com/comfyanonymous/ComfyUI.git .
|
| 17 |
+
|
| 18 |
+
# 安装依赖 (优先安装 Torch,确保版本匹配)
|
| 19 |
+
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# 创建模型目录(可选:在此处预下载一个小模型,如 SD1.5 Pruned)
|
| 23 |
+
RUN wget -O models/checkpoints/v1-5-pruned-emaonly.safetensors \
|
| 24 |
+
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
|
| 25 |
+
|
| 26 |
+
# 暴露 Hugging Face 指定端口
|
| 27 |
+
EXPOSE 7860
|
| 28 |
+
|
| 29 |
+
# 启动命令:使用 --listen 监听所有接口,--port 7860 适配 HF
|
| 30 |
+
# 如果是纯 CPU 环境,建议加上 --cpu 参数
|
| 31 |
+
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--cpu"]# 使用支持 CUDA 的基础镜像(如果要在 CPU 运行,基础镜像也通用)
|
README.md
CHANGED
|
@@ -1 +1,10 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
emoji: 🔥
|
| 3 |
+
colorFrom: red
|
| 4 |
+
colorTo: blue
|
| 5 |
+
sdk: docker
|
| 6 |
+
app_port: 7860
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
up-gh.sh
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
git remote add gh_vec2 git@github.com:vector0902/hf-comfyui.git
|
| 3 |
+
|
| 4 |
+
git add .
|
| 5 |
+
git commit -am update
|
| 6 |
+
git push -f gh_vec2 || sudo su vec2 -c 'git push -f gh_vec2'
|
| 7 |
+
|
| 8 |
+
# to pull:
|
| 9 |
+
# git pull gh_vec2 main
|
up.sh
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# CAUTION:
|
| 3 |
+
# check the destination !
|
| 4 |
+
# this will cause total rebuild !!
|
| 5 |
+
#
|
| 6 |
+
|
| 7 |
+
REMOTE=git@hf.co:spaces/hellohell/cfcpu
|
| 8 |
+
|
| 9 |
+
echo Carefully check this remote is what you want to OVERWRITE and REBUILD:
|
| 10 |
+
echo
|
| 11 |
+
echo $REMOTE
|
| 12 |
+
echo
|
| 13 |
+
# echo -e "Desired:\t$REMOTE"
|
| 14 |
+
# echo -en "Already set:\t"
|
| 15 |
+
# git remote get-url hf
|
| 16 |
+
|
| 17 |
+
read -p "Press ENTER to confirm overwriting! "
|
| 18 |
+
|
| 19 |
+
git remote remove hf
|
| 20 |
+
git remote add hf $REMOTE
|
| 21 |
+
|
| 22 |
+
# exit # test
|
| 23 |
+
|
| 24 |
+
git add .
|
| 25 |
+
git commit -am update
|
| 26 |
+
git push -f hf
|