Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You really need to make "Pre builds" for the 2.4.1 torch version because otherwise this extension IS A NIGHTMARE. #342

Open
GPU-server opened this issue Oct 10, 2024 · 11 comments

Comments

@GPU-server
Copy link

GPU-server commented Oct 10, 2024

Yesterday I had this workflow working, and today this:
image
It broke completely.

What happened?
Well as explained here (ltdrdata/ComfyUI-Manager#1136) and here (#341), anytime I install a new custom nodes (through manager), the following happen:

  • Manually installed Torch (2.4.0 which corresponds to one of the pre builds avaialble) is uninstalled ,
  • It is replaced with the latest torch (2.4.1 today)
  • ComfyUI can even "forget" Torch exist and is unable to start. (Despite pip list showing Torch 2.4.1 being present, (maybe it is installing a version without that extra "cu121" next to the library, don't know if that any meaning)

After installing some extension and missing nodes related to other extensions (such as Comfy Essentials, which par of one of the 3D pack example workflows (https://github.com/MrForExample/ComfyUI-3D-Pack/tree/main/_Example_Workflows), 3D pack is no longer working yet again.. yet again,. Despite having done the impossible to make it work. Despite reinstalling Torch 2.4.0cu121 one million additional time.

@jakechai
Copy link
Contributor

You need a separate version of Comfy UI for the 3D Pack and keep as few custom nodes as possible.
Try this portable version, not the latest one, which works for me.
Please check my installation tips if the 3D Pack auto-installation fails.

@GPU-server
Copy link
Author

Thanks @jakechai but I did not even try to get new nodes from other extensions per se, it was just the missing nodes from the "example workflows" provided by 3D pack itself..

@liulsg
Copy link

liulsg commented Oct 11, 2024

@jakechai Halfway through, it automatically updates to torch 2.4.0.

@jakechai
Copy link
Contributor

2.4.0 is fine as long as it doesn't automatically upgrade to 2.4.1.

@liulsg
Copy link

liulsg commented Oct 11, 2024

@jakechai
3d-pack plug-in can display normally, but run to the screenshot position error, do you know why? If you can point out the problem, thank you very much
image
image

G:\AI\ComfyUI_3D-pack>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
Total VRAM 22528 MB, total RAM 32662 MB
pytorch version: 2.4.0+cu121
G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\xformers\ops\fmha\flash.py:211: FutureWarning: torch.library.impl_abstract was renamed to torch.library.register_fake. Please use that instead; we will remove torch.library.impl_abstract in a future version of PyTorch.
@torch.library.impl_abstract("xformers_flash::flash_fwd")
G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\xformers\ops\fmha\flash.py:344: FutureWarning: torch.library.impl_abstract was renamed to torch.library.register_fake. Please use that instead; we will remove torch.library.impl_abstract in a future version of PyTorch.
@torch.library.impl_abstract("xformers_flash::flash_bwd")
xformers version: 0.0.27.post2
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
Using xformers cross attention
[Prompt Server] web root: G:\AI\ComfyUI_3D-pack\ComfyUI\web
G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kornia\feature\lightglue.py:44: 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)
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)

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

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)

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

Warn!: xFormers is available (Attention)
Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(

Warn!: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\craftsman\utils\checkpoint.py:39: 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

Warn!: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\craftsman\utils\checkpoint.py:50: 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

Loading: ComfyUI-Impact-Pack (V7.9)

WARNING ⚠️ Known issue with torch==2.4.0 on Windows with CPU, recommend upgrading to torch>=2.4.1 to resolve ultralytics/ultralytics#15049

Loading: ComfyUI-Impact-Pack (Subpack: V0.7)

[WARN] ComfyUI-Impact-Pack: ComfyUI or ComfyUI-Manager is an outdated version.
[Impact Pack] Wildcards loading done.

Loading: ComfyUI-Inspire-Pack (V1.3)

Total VRAM 22528 MB, total RAM 32662 MB
pytorch version: 2.4.0+cu121
xformers version: 0.0.27.post2
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
python_executable_path: G:\AI\ComfyUI_3D-pack\python_embeded\python.exe
python_embeded_path: G:\AI\ComfyUI_3D-pack\python_embeded

Import times for custom nodes:
0.0 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\AIGODLIKE-COMFYUI-TRANSLATION
0.0 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-Unique3D
0.0 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus
0.0 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
0.0 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-KJNodes
0.1 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack
0.2 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
0.3 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite
9.7 seconds: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack

Starting server

To see the GUI go to: http://127.0.0.1:8188
got prompt
[Comfy3D] [Load_Large_Multiview_Gaussian_Model] loaded model ckpt from G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Checkpoints\LGM\model_fp16.safetensors
Fetching 5 files: 100%|██████████████████████████████████████████████████████████████████████████| 5/5 [00:00<?, ?it/s]
Loading pipeline components...: 0%| | 0/5 [00:00<?, ?it/s]An error occurred while trying to fetch G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Checkpoints\Diffusers\flamehaze1115/wonder3d-v1.0\unet: Error no file named diffusion_pytorch_model.safetensors found in directory G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Checkpoints\Diffusers\flamehaze1115/wonder3d-v1.0\unet.
Defaulting to unsafe serialization. Pass allow_pickle=False to raise an error instead.
The config attributes {'cross_domain_attention': False, 'joint_attention': False, 'joint_attention_twice': True} were passed to UNetMV2DConditionModel, but are not expected and will be ignored. Please verify your config.json configuration file.
Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diffusers\models\lora.py:306: FutureWarning: LoRACompatibleConv is deprecated and will be removed in version 1.0.0. Use of LoRACompatibleConv is deprecated. Please switch to PEFT backend by installing PEFT: pip install peft.
deprecate("LoRACompatibleConv", "1.0.0", deprecation_message)

Loading pipeline components...: 60%|███████████████████████████████▏ | 3/5 [00:01<00:01, 1.51it/s]An error occurred while trying to fetch G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Checkpoints\Diffusers\flamehaze1115/wonder3d-v1.0\vae: Error no file named diffusion_pytorch_model.safetensors found in directory G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Checkpoints\Diffusers\flamehaze1115/wonder3d-v1.0\vae.
Defaulting to unsafe serialization. Pass allow_pickle=False to raise an error instead.
Loading pipeline components...: 100%|████████████████████████████████████████████████████| 5/5 [00:02<00:00, 1.73it/s]
Warn!: You have disabled the safety checker for <class 'Wonder3D.pipelines.pipeline_mvdiffusion_image.MVDiffusionImagePipeline'> by passing safety_checker=None. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at huggingface/diffusers#254 .
Warn!: G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Wonder3D\data\single_image_dataset.py:264: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_new.cpp:281.)
elevations = torch.as_tensor(elevations).float().squeeze(1)

Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\transformers\models\clip\modeling_clip.py:480: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(

[Comfy3D] [Save_3DGS] Saving model to G:\AI\ComfyUI_3D-pack\ComfyUI\output\LGMTest\KungFuCat.ply
Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(

Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\gridencoder\grid.py:23: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead.
@custom_fwd

Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\gridencoder\grid.py:70: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
@custom_bwd

Warn!: G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\gridencoder\grid.py:188: FutureWarning: torch.cuda.amp.autocast(args...) is deprecated. Please use torch.amp.autocast('cuda', args...) instead.
@torch.cuda.amp.autocast(enabled=False)

Number of points at loading : 45661
[INFO] fitting nerf...
0%| | 0/1024 [00:00<?, ?it/s]
!!! Exception during processing !!! Allocation on device
Traceback (most recent call last):
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 317, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 192, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1846, in convert_gs_ply
imgs, alphas = converter.fit_nerf(training_nerf_iterations, training_nerf_resolution)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\LGM\nerf_marching_cubes_converter.py", line 180, in fit_nerf
image_gt, alpha_gt = self.render_gs(pose)
^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\LGM\nerf_marching_cubes_converter.py", line 82, in render_gs
out = self.gs_renderer.render(self.gaussians.unsqueeze(0), cam_view.unsqueeze(0), cam_view_proj.unsqueeze(0), cam_pos.unsqueeze(0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\LGM\core\gs.py", line 75, in render
rendered_image, radii, rendered_depth, rendered_alpha = rasterizer(
^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self.call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1562, in call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diff_gaussian_rasterization_init
.py", line 213, in forward
return rasterize_gaussians(
^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diff_gaussian_rasterization_init
.py", line 32, in rasterize_gaussians
return RasterizeGaussians.apply(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\autograd\function.py", line 574, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diff_gaussian_rasterization_init
.py", line 92, in forward
num_rendered, color, depth, alpha, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Allocation on device

Prompt executed in 16.79 seconds

@jakechai
Copy link
Contributor

"Allocation on device" errors most likely mean that you do not have enough VRAM. I haven't tried this NeRF node because my VRAM is only 8G.

@cwkean87
Copy link

@jakechai , thanks for the youtube guide. i was following exactly but is stuck here. can help pls? i have added the MSVC into the path, fyi. thanks

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\yvals.h(20): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
[5/6] cl /showIncludes -DTORCH_EXTENSION_NAME=nvdiffrast_plugin_gl -DTORCH_API_INCLUDE_EXTENSION_H -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\torch\csrc\api\include -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\TH -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -IC:\ComfyUI_windows_portable\python_embeded\Include -D_GLIBCXX_USE_CXX11_ABI=0 /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++17 -DNVDR_TORCH -c C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\rasterize_gl.cpp /Forasterize_gl.o
FAILED: rasterize_gl.o
cl /showIncludes -DTORCH_EXTENSION_NAME=nvdiffrast_plugin_gl -DTORCH_API_INCLUDE_EXTENSION_H -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\torch\csrc\api\include -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\TH -IC:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -IC:\ComfyUI_windows_portable\python_embeded\Include -D_GLIBCXX_USE_CXX11_ABI=0 /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++17 -DNVDR_TORCH -c C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\rasterize_gl.cpp /Forasterize_gl.o
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34123 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\yvals.h(20): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
ninja: build stopped: subcommand failed.

@jakechai
Copy link
Contributor

@cwkean87 I haven't encountered this issue yet.
You may need to add ninja.exe to the environment path first. For me, it is ...\ComfyUI_windows_portable_3D\python_embeded\Lib\site-packages\ninja\data\bin
If it doesn't work, it may be your Windows SDK issue. Check this.

@cwkean87
Copy link

@cwkean87 I haven't encountered this issue yet. You may need to add ninja.exe to the environment path first. For me, it is ...\ComfyUI_windows_portable_3D\python_embeded\Lib\site-packages\ninja\data\bin If it doesn't work, it may be your Windows SDK issue. Check this.

thanks @jakechai , end up it's the windows SDK that's not properly installed. Awesome!!

@GPU-server
Copy link
Author

What's windows SDK @cwkean87 ?

@cwkean87
Copy link

What's windows SDK @cwkean87 ?

Install the VS build tool, make sure you checked the C++ dev for window , then in the list of feature, check the Win 10 SDK as well. Hope it works for you. I spent like 2 full days just to troubleshoot the installation. It's a pain!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants