Skip to content

Commit

Permalink
Ready for new version of Comfy3D
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Jul 9, 2024
1 parent 2384a82 commit fa42159
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
23 changes: 14 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ __The rest of README was translated by ChatGPT and edited by me (how lazy, how g
* Pre-installed with 30+ custom nodes including:

** link:https://github.com/MrForExample/ComfyUI-3D-Pack[ComfyUI-3D-Pack]
with dependencies that make my head spin
[.line-through]#with dependencies that make my head spin#
(Now Comfy3D can be installed through Manager elegantly)

** link:https://github.com/WASasquatch/was-node-suite-comfyui/blob/main/requirements.txt[WAS Node Suite]
with fixed dependencies (prone to version chaos) and no longer actively developed
[.line-through]#with fixed dependencies (prone to version chaos) and no longer actively developed#
(Now its versions are better numbered)

** link:https://github.com/Gourieff/comfyui-reactor-node[ReActor Node]
and
Expand Down Expand Up @@ -53,26 +55,29 @@ that download model files on the first run (often causing freezing for users wit

== Tips for Usage

1. If model files are already saved in another location and you don't want to move them, you can configure the program to load them:
1. Model Path: If model files are already saved in another location and you don't want to move them, you can configure the program to load them:
** Rename `extra_model_paths.yaml.example` in the `ComfyUI` directory to `extra_model_paths.yaml`.
** Edit `extra_model_paths.yaml` according to the directory structure, removing corresponding comments.
** Items other than `base_path` can be added or removed freely to map newly added subdirectories; the program will try load all of them.

2. If a network proxy is needed, edit `run_nvidia_gpu.bat` and add the following at the beginning:
2. Proxy: If a network proxy is needed, edit `run_nvidia_gpu.bat` and add the following at the beginning:
[source,cmd]
set HTTP_PROXY=http://localhost:1081
set HTTPS_PROXY=http://localhost:1081

3. Take advantage of the ComfyUI-Manager (the *Manager* button located at the bottom right corner of the ComfyUI page) to install additional custom nodes, update ComfyUI and nodes, or disable unnecessary nodes.
3. Manager: Take advantage of the ComfyUI-Manager (the *Manager* button located at the bottom right corner of the ComfyUI page) to install additional custom nodes, update ComfyUI and nodes, or disable unnecessary nodes.
** If you find that some unused nodes affect the startup time, you can disable them.

4. Click the gear (⚙) icon at the top right corner of the ComfyUI page to modify settings. Find *AGLTranslation* to change the language (default is English, options are {Chinese, Japanese, Korean}).
4. Language: Click the gear (⚙) icon at the top right corner of the ComfyUI page to modify settings. Find *AGLTranslation* to change the language (default is English, options are {Chinese, Japanese, Korean}).

5. Besides SD models, some custom nodes may require downloading more models, such as the
5. 3D-Pack: Besides SD models, some custom nodes may require downloading more models, such as the
link:https://huggingface.co/stabilityai/TripoSR/blob/main/model.ckpt[TripoSR]
used in 3D workflows.
However, including all of them would make the package too large, so they were not included.
Moreover, you still need MS VC++ for some GPU-related codes to be compiled in runtime.
Moreover, you still need to install
https://visualstudio.microsoft.com/downloads/?q=build+tools[Visual Studio Build Tools 2022]
with "Desktop development with C++" workload
to fully utilize ComfyUI-3D-Pack (some JIT codes need to be compiled in runtime).
If you need to use the corresponding nodes, please pay attention to the respective project pages.

6. How to upgrade: ComfyUI-Manager can do most updates, but if you want a "fresh" upgrade, you can first delete the `python_embeded` directory, and then extract the same-named directory from the new version's package to the original location. Additional "try fix" in ComfyUI-Manager may be needed.
Expand Down Expand Up @@ -163,7 +168,7 @@ Personally, I prefer to enable xFormers when generating videos.

Additionally, including xFormers satisfies the dependencies of some nodes like link:https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved/blob/main/requirements.txt[AnimateAnyone Evolved].

== Creating Your Own Integration Package
== Creating Your Own AIO Package

This repository utilizes a pipeline to build the integration package, and the codebase doesn't contain specific configurations or require additional access permissions. Hence, you can directly fork this repository to start executing the GitHub Workflow.

Expand Down
10 changes: 7 additions & 3 deletions README.zh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ image::docs/screenshot.zh.webp["Screenshot"]
## 特点

* 预装了 30+ 自定义节点,包括:
** 依赖项看得人头皮发麻的
** [.line-through]#依赖项看得人头皮发麻的#
https://github.com/MrForExample/ComfyUI-3D-Pack/[ComfyUI-3D-Pack]
** 依赖项版本固定(容易导致版本混乱)且不再活跃开发的
(现在不麻了,官方带安装脚本了,可以用 ComfyUI-Manager 安装了)
** [.line-through]#依赖项版本固定(容易导致版本混乱)且不再活跃开发的#
https://github.com/WASasquatch/was-node-suite-comfyui/blob/main/requirements.txt[WAS Node Suite]
(现在改好了,版本不卡了)
** 初次启动时会下载模型文件(国内用户经常卡住不动)的
https://github.com/Gourieff/comfyui-reactor-node[ReActor Node]
Expand Down Expand Up @@ -65,7 +67,9 @@ set HTTPS_PROXY=http://localhost:1081
4. 除了绘图模型外,一些自定义节点还需要下载更多模型,比如 3D 模型会用到的
https://huggingface.co/stabilityai/TripoSR/blob/main/model.ckpt[TripoSR]
,但如果都打包进来就太大了,这里权衡之下没有放。
此外 3D 相关的部分组件依然需要安装 VC++,因为有些 GPU 相关代码需要运行时编译。
此外 3D 相关的部分组件依然需要安装
https://visualstudio.microsoft.com/downloads/?q=build+tools[Visual Studio 2022](选择安装“桌面C++开发”)
,因为有些 GPU 相关代码需要运行时编译(一些 Torch 的 JIT CPP 扩展)。
如果需要用到对应节点,还请留意相应的项目页面。
5. 如何大更新:ComfyUI-Manager 可以完成大部分的更新,但如果想要“翻新式”更新,可以先删除 `python_embeded` 目录,再将新版压缩包中的同名目录解压到原来位置即可。可能需要额外在 ComfyUI-Manager 中“try fix”。
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ numexpr
numpy<2
omegaconf
onnxruntime
onnxruntime-gpu
open-clip-torch
opencv-contrib-python
opencv-python
Expand Down Expand Up @@ -63,10 +62,10 @@ pyyaml
qrcode[pil]
regex
rembg
requests
requirements-parser
rich
rich-argparse
roma
safetensors
scikit-image
scikit-learn
Expand Down
24 changes: 15 additions & 9 deletions stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ curl https://www.python.org/ftp/python/3.11.9/python-3.11.9-embed-amd64.zip \
unzip python_embeded.zip -d "$workdir"/python_embeded

# ComfyUI-3D-Pack, part 1/2
$gcs https://github.com/MrForExample/ComfyUI-3D-Pack.git \
"$workdir"/ComfyUI-3D-Pack
$gcs https://github.com/MrForExample/Comfy3D_Pre_Builds.git \
"$workdir"/Comfy3D_Pre_Builds

mv \
"$workdir"/ComfyUI-3D-Pack/_Pre_Builds/_Python311_cpp/include \
"$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py311/include \
"$workdir"/python_embeded/include

mv \
"$workdir"/ComfyUI-3D-Pack/_Pre_Builds/_Python311_cpp/libs \
"$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py311/libs \
"$workdir"/python_embeded/libs

# Setup Python embeded, part 2/3
Expand All @@ -37,7 +37,7 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
--upgrade pip wheel setuptools Cython cmake

./python.exe -s -m pip install \
xformers==0.0.25.post1 torchvision torchaudio \
xformers torchvision torchaudio \
--index-url https://download.pytorch.org/whl/cu121 \
--extra-index-url https://pypi.org/simple

Expand All @@ -47,18 +47,24 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
./python.exe -s -m pip install \
-r "$workdir"/requirements2.txt

./python.exe -s -m pip install \
--force-reinstall onnxruntime-gpu \
./python.exe -s -m pip uninstall --yes \
onnxruntime-gpu \
&& ./python.exe -s -m pip --no-cache-dir install \
onnxruntime-gpu \
--index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ \
--extra-index-url https://pypi.org/simple \
&& ./python.exe -s -m pip install \
mediapipe

# ComfyUI-3D-Pack, part 2/2
./python.exe -s -m pip install \
"$workdir"/ComfyUI-3D-Pack/_Pre_Builds/_Wheels_win_py311_cu121/*.whl
"$workdir"/Comfy3D_Pre_Builds/_Build_Wheels/_Wheels_win_py311_cu121/*.whl

# From: https://github.com/rusty1s/pytorch_scatter?tab=readme-ov-file#binaries
./python.exe -s -m pip install \
torch-scatter -f https://data.pyg.org/whl/torch-2.3.0+cu121.html

rm -rf "$workdir"/ComfyUI-3D-Pack
rm -rf "$workdir"/Comfy3D_Pre_Builds

# Add Ninja binary (replacing PIP one)
curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip \
Expand Down

0 comments on commit fa42159

Please sign in to comment.