YanWenKun / ComfyUI-Windows-Portable

🎨ComfyUI standalone pack with 30+ custom nodes. | ComfyUI 大号整合包,预装大量自定义节点(不含SD模型)
GNU General Public License v3.0
114 stars 14 forks source link

运行到转换obj节点就报错 #21

Open liulsg opened 1 week ago

liulsg commented 1 week ago

image image

YanWenKun commented 1 week ago

报 Allocation 很可能是显存不够 报错日志咋说的?(记得用一对三反撇 ``` 把日志内容包起来)

liulsg commented 1 week ago

ComfyUI Error Report

Error Details

## System Information
- **ComfyUI Version:** v0.2.2
- **Arguments:** ComfyUI\main.py --windows-standalone-build
- **OS:** nt
- **Python Version:** 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
- **Embedded Python:** true
- **PyTorch Version:** 2.4.0+cu121
## Devices

- **Name:** cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
  - **Type:** cuda
  - **VRAM Total:** 23621861376
  - **VRAM Free:** 18755109594
  - **Torch VRAM Total:** 3523215360
  - **Torch VRAM Free:** 27038426

## Logs

2024-10-12 01:42:01,320 - root - INFO - Total VRAM 22528 MB, total RAM 32662 MB 2024-10-12 01:42:01,320 - root - INFO - pytorch version: 2.4.0+cu121 2024-10-12 01:42:02,610 - root - INFO - xformers version: 0.0.27.post2 2024-10-12 01:42:02,610 - root - INFO - Set vram state to: NORMAL_VRAM 2024-10-12 01:42:02,610 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync 2024-10-12 01:42:02,822 - root - INFO - Using xformers cross attention 2024-10-12 01:42:03,992 - root - INFO - [Prompt Server] web root: G:\AI\ComfyUI_3D-pack\ComfyUI\web 2024-10-12 01:42:04,998 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diffusers\models\transformers\transformer_2d.py:34: FutureWarning: Transformer2DModelOutput is deprecated and will be removed in version 1.0.0. Importing Transformer2DModelOutput from diffusers.models.transformer_2d is deprecated and this will be removed in a future version. Please use from diffusers.models.modeling_outputs import Transformer2DModelOutput, instead. deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)

2024-10-12 01:42:06,318 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\nn__init__.py:31: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)

2024-10-12 01:42:06,318 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\nn__init__.py:37: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_bwd

2024-10-12 01:42:06,363 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\TriplaneGaussian\utils\ops.py:38: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @custom_fwd(cast_inputs=torch.float32)

2024-10-12 01:42:06,363 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\TriplaneGaussian\utils\ops.py:44: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead. @custom_bwd

## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":24,"last_link_id":38,"nodes":[{"id":5,"type":"InvertMask","pos":{"0":170,"1":540},"size":{"0":210,"1":26},"flags":{},"order":4,"mode":0,"inputs":[{"name":"mask","type":"MASK","link":3,"label":"遮罩"}],"outputs":[{"name":"MASK","type":"MASK","links":[25,32],"slot_index":0,"shape":3,"label":"遮罩"}],"properties":{"Node name for S&R":"InvertMask"}},{"id":22,"type":"[Comfy3D] Wonder3D MVDiffusion Model","pos":{"0":440,"1":460},"size":{"0":430.8000183105469,"1":170},"flags":{},"order":6,"mode":0,"inputs":[{"name":"mvdiffusion_pipe","type":"DIFFUSERS_PIPE","link":29,"label":"MVDiffusion节点束"},{"name":"reference_image","type":"IMAGE","link":33,"label":"参考图像"},{"name":"reference_mask","type":"MASK","link":32,"label":"参考遮罩"}],"outputs":[{"name":"multiview_images","type":"IMAGE","links":[34],"slot_index":0,"shape":3,"label":"多视图"},{"name":"multiview_normals","type":"IMAGE","links":[],"slot_index":1,"shape":3,"label":"法向多视图"},{"name":"orbit_camposes","type":"ORBIT_CAMPOSES","links":null,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] Wonder3D MVDiffusion Model"},"widgets_values":[0,"fixed",1,30]},{"id":23,"type":"GetImagesFromBatchIndexed","pos":{"0":918,"1":461},"size":{"0":243.60000610351562,"1":76},"flags":{},"order":7,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":34,"label":"图像"}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[35,36],"slot_index":0,"shape":3,"label":"图像"}],"properties":{"Node name for S&R":"GetImagesFromBatchIndexed"},"widgets_values":["0, 2, 3, 4"]},{"id":1,"type":"[Comfy3D] Load Large Multiview Gaussian Model","pos":{"0":917,"1":598},"size":{"0":315,"1":82},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"lgm_model","type":"LGM_MODEL","links":[22],"slot_index":0,"shape":3,"label":"LGM模型"}],"properties":{"Node name for S&R":"[Comfy3D] Load Large Multiview Gaussian Model"},"widgets_values":["model_fp16.safetensors","big"]},{"id":2,"type":"[Comfy3D] Load Diffusers Pipeline","pos":{"0":-138.35284423828125,"1":-248.5692138671875},"size":{"0":375.3948669433594,"1":154},"flags":{},"order":1,"mode":4,"inputs":[],"outputs":[{"name":"pipe","type":"DIFFUSERS_PIPE","links":[23],"slot_index":0,"shape":3,"label":"节点束"}],"properties":{"Node name for S&R":"[Comfy3D] Load Diffusers Pipeline"},"widgets_values":["MVDreamPipeline","ashawkey/imagedream-ipmv-diffusers","",true,""]},{"id":18,"type":"[Comfy3D] MVDream Model","pos":{"0":451.64715576171875,"1":-248.5692138671875},"size":{"0":405.5999755859375,"1":286},"flags":{},"order":5,"mode":4,"inputs":[{"name":"mvdream_pipe","type":"DIFFUSERS_PIPE","link":23,"label":"MVDream节点束"},{"name":"reference_image","type":"IMAGE","link":24,"label":"参考图像"},{"name":"reference_mask","type":"MASK","link":25,"label":"参考遮罩"}],"outputs":[{"name":"multiview_images","type":"IMAGE","links":[],"slot_index":0,"shape":3,"label":"多视图"},{"name":"orbit_camposes","type":"ORBIT_CAMPOSES","links":null,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] MVDream Model"},"widgets_values":["","ugly, blurry, pixelated obscure, unnatural colors, poor lighting, dull, unclear, cropped, lowres, low quality, artifacts, duplicate",0,"fixed",4.99,30,0]},{"id":4,"type":"LoadImage","pos":{"0":-190,"1":480},"size":{"0":315,"1":314},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[24,33],"slot_index":0,"shape":3,"label":"图像"},{"name":"MASK","type":"MASK","links":[3],"slot_index":1,"shape":3,"label":"遮罩"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["KungFuCat.png","image"]},{"id":19,"type":"PreviewImage","pos":{"0":1278,"1":138},"size":{"0":210,"1":246},"flags":{},"order":9,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":36,"label":"图像"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"}},{"id":14,"type":"[Comfy3D] Save 3D Mesh","pos":{"0":1996.1025390625,"1":214.90586853027344},"size":{"0":259.5017395019531,"1":58},"flags":{},"order":13,"mode":0,"inputs":[{"name":"mesh","type":"MESH","link":37,"label":"网格"}],"outputs":[{"name":"save_path","type":"STRING","links":[16],"slot_index":0,"shape":3,"label":"保存路径"}],"properties":{"Node name for S&R":"[Comfy3D] Save 3D Mesh"},"widgets_values":["LGMTest/KungFuCat.obj"]},{"id":15,"type":"[Comfy3D] Preview 3DMesh","pos":{"0":2289,"1":215},"size":[600,500],"flags":{},"order":15,"mode":0,"inputs":[{"name":"mesh_file_path","type":"STRING","link":16,"widget":{"name":"mesh_file_path"},"label":"网格文件路径"}],"outputs":[],"properties":{"Node name for S&R":"[Comfy3D] Preview 3DMesh"},"widgets_values":["",null]},{"id":10,"type":"[Comfy3D] Preview 3DGS","pos":{"0":2203,"1":776},"size":[600,500],"flags":{},"order":14,"mode":0,"inputs":[{"name":"gs_file_path","type":"STRING","link":11,"widget":{"name":"gs_file_path"},"label":"gs文件路径"}],"outputs":[],"properties":{"Node name for S&R":"[Comfy3D] Preview 3DGS"},"widgets_values":["",null]},{"id":12,"type":"[Comfy3D] Switch 3DGS Axis","pos":{"0":1572,"1":776},"size":{"0":210,"1":106},"flags":{},"order":10,"mode":0,"inputs":[{"name":"gs_ply","type":"GS_PLY","link":19,"label":"gs_ply"}],"outputs":[{"name":"switched_gs_ply","type":"GS_PLY","links":[13],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] Switch 3DGS Axis"},"widgets_values":["+x","-y","-z"]},{"id":9,"type":"[Comfy3D] Save 3DGS","pos":{"0":1813,"1":777},"size":{"0":315,"1":58},"flags":{},"order":12,"mode":0,"inputs":[{"name":"gs_ply","type":"GS_PLY","link":13,"label":"gs_ply"}],"outputs":[{"name":"save_path","type":"STRING","links":[11],"slot_index":0,"shape":3,"label":"保存路径"}],"properties":{"Node name for S&R":"[Comfy3D] Save 3DGS"},"widgets_values":["LGMTest/KungFuCat.ply"]},{"id":17,"type":"[Comfy3D] Large Multiview Gaussian Model","pos":{"0":1270,"1":461},"size":{"0":252,"1":46},"flags":{},"order":8,"mode":0,"inputs":[{"name":"multiview_images","type":"IMAGE","link":35,"label":"多视图"},{"name":"lgm_model","type":"LGM_MODEL","link":22,"label":"LGM模型"}],"outputs":[{"name":"gs_ply","type":"GS_PLY","links":[19,38],"slot_index":0,"shape":3,"label":"gs_ply"}],"properties":{"Node name for S&R":"[Comfy3D] Large Multiview Gaussian Model"}},{"id":24,"type":"[Comfy3D] Convert 3DGS to Mesh with NeRF and Marching Cubes","pos":{"0":1566,"1":216},"size":{"0":411.6000061035156,"1":386},"flags":{},"order":11,"mode":0,"inputs":[{"name":"gs_ply","type":"GS_PLY","link":38,"label":"gs_ply"}],"outputs":[{"name":"mesh","type":"MESH","links":[37],"slot_index":0,"shape":3,"label":"网格"},{"name":"imgs","type":"IMAGE","links":null,"shape":3},{"name":"alphas","type":"MASK","links":null,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] Convert 3DGS to Mesh with NeRF and Marching Cubes"},"widgets_values":["big",1024,128,256,128,10,2048,512,512,512,512,1024,false]},{"id":20,"type":"[Comfy3D] Load Diffusers Pipeline","pos":{"0":-264,"1":278},"size":{"0":392.1646728515625,"1":154},"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"pipe","type":"DIFFUSERS_PIPE","links":[29],"slot_index":0,"shape":3,"label":"节点束"}],"properties":{"Node name for S&R":"[Comfy3D] Load Diffusers Pipeline"},"widgets_values":["Wonder3DMVDiffusionPipeline","flamehaze1115/wonder3d-v1.0","",false,""]}],"links":[[3,4,1,5,0,"MASK"],[11,9,0,10,0,"STRING"],[13,12,0,9,0,"GS_PLY"],[16,14,0,15,0,"STRING"],[19,17,0,12,0,"GS_PLY"],[22,1,0,17,1,"LGM_MODEL"],[23,2,0,18,0,"DIFFUSERS_PIPE"],[24,4,0,18,1,"IMAGE"],[25,5,0,18,2,"MASK"],[29,20,0,22,0,"DIFFUSERS_PIPE"],[32,5,0,22,2,"MASK"],[33,4,0,22,1,"IMAGE"],[34,22,0,23,0,"IMAGE"],[35,23,0,17,0,"IMAGE"],[36,23,0,19,0,"IMAGE"],[37,24,0,14,0,"MESH"],[38,17,0,24,0,"GS_PLY"]],"groups":[{"title":"MVDream: 4 multi-views","bounding":[-172,-366,1139,436],"color":"#3f789e","font_size":24,"flags":{}}],"config":{},"extra":{"ds":{"scale":0.6830134553650712,"offset":[166.03159570994592,124.89708290105193]}},"version":0.4}



## Additional Context
(Please add any additional context or steps to reproduce the error here)
liulsg commented 1 week ago

我从comfyui-manage安装的和下载的您的安装包,都是这个问题。 在之前所有的自带工作流都可以运行。

YanWenKun commented 1 week ago

diff_gaussian_rasterization 报的错,看起来 #14 很像,那个问题的解决方法是添加 TORCH_CUDA_ARCH_LIST 环境变量,指定自己显卡对应的架构版本。我在 run_nvidia_gpu.bat 已经添加了相关命令。

  1. 你先看看 TORCH_CUDA_ARCH_LIST 有没有正常启用。

  2. 如果该项正常的话就比较棘手了,diff_gaussian_rasterization 本身是位大佬读博时顺便搞的项目,其上游项目也一年多没更新了,最麻烦的是 CUDA C++ 报错信息少得可怜,如果有其他线索/日志信息,可以试试找找原因,没有的话只能从环境配置上尝试了。

liulsg commented 1 week ago

我看有人说用您修改的较低版本torch2.2.0可行,我下载试了下,运行到转换obj网格竟然 需要几百T的显存(也有可能是内存) 我已经在环境变量添加了TORCH_CUDA_ARCH_LIST=12.1(我安装的cuda是12.1 ,我最后说明下:之前运行完全没问题)

YanWenKun commented 1 week ago

这个arch是gpu架构(sm)版本,比如40系ada就是8.9,而非cuda版本 参考: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

------------------ 原始邮件 ------------------ 发件人: liulsg @.> 发送时间: 2024年10月12日 13:17 收件人: YanWenKun/ComfyUI-Windows-Portable @.> 抄送: YAN Wenkun @.>, Comment @.> 主题: Re: [YanWenKun/ComfyUI-Windows-Portable] 运行到转换obj节点就报错 (Issue #21)

我看有人说用您修改的较低版本torch2.2.0可行,我下载试了下,运行到转换obj网格竟然 需要几百T的显存(也有可能是内存) 我已经在环境变量添加了TORCH_CUDA_ARCH_LIST=12.1(我安装的cuda是12.1 ,我最后说明下:之前运行完全没问题)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

YanWenKun commented 1 week ago

倒是还有个点,CUDA Toolkit 12.1 可能有 bug,装最新的 12.6 即可,兼容这些基于 12.1 编译的程序

------------------ 原始邮件 ------------------ 发件人: liulsg @.> 发送时间: 2024年10月12日 13:17 收件人: YanWenKun/ComfyUI-Windows-Portable @.> 抄送: YAN Wenkun @.>, Comment @.> 主题: Re: [YanWenKun/ComfyUI-Windows-Portable] 运行到转换obj节点就报错 (Issue #21)

我看有人说用您修改的较低版本torch2.2.0可行,我下载试了下,运行到转换obj网格竟然 需要几百T的显存(也有可能是内存) 我已经在环境变量添加了TORCH_CUDA_ARCH_LIST=12.1(我安装的cuda是12.1 ,我最后说明下:之前运行完全没问题)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

liulsg commented 1 week ago

我的显卡是2080ti,好像最高支持cuda12.5

liulsg commented 1 week ago

@YanWenKun 经过多个torch版本以及cuda版本的反复安装,我确定问题出在diff-gaussian-rasterization上,好像建立这个轮子的时候一直编译失败,即使重新配置了环境也不行。

YanWenKun commented 1 week ago

编译失败是指它运行时编译 JIT 代码失败,还是尝试 build wheel 失败? 如果是前者的话,尝试本地编译 diff-gaussian-rasterization 也许可行 (代码简略,注意配置 TORCH_CUDA_ARCH_LIST=7.5)

pip wheel -w tmp_wheels git+https://github.com/ashawkey/diff-gaussian-rasterization.git

liulsg commented 5 days ago

已经解决。cuda11.8 torch2.3.0 py311 cuda121 torch py312测试都没有问题了。 解决办法: 1.重装vs2022(17.9.0版本 看评论更高版本可能有问题) 2.通过anaconda 重装torch 安装comfyui 3通过comfyui-manage安装3D PACK 4.通过cuda卸载diff-gaussian-rasterization然后git diff-gaussian-rasterization 并安装 5.剩下的缺什么模块通过cuda安装 6.环境变量添加najia vs路径 等

liulsg commented 5 days ago

3d-pack安装diff-gaussian-rasterization 好像编译的会出问题,但是通过git源代码再安装就可以。

YanWenKun commented 5 days ago

Nice,看来 3D-Pack 作者编译的 wheel 也有些疑难兼容问题,我考虑加一个重新编译wheel的脚本供用户执行。或者单独做一个3D-Pack only包,把它那一大堆运行时下载的模型给打包进去

Message ID: @.***>

liulsg commented 5 days ago

不知道您说的是依赖库还是需要的模型,那个模型共计70G! 至于您提到的制作单独的编译脚本,真的是一个好的想法。