Closed MNeMoNiCuZ closed 3 months ago
Try downgrading your PyTorch version and test if the same issue occurs.
Try downgrading your PyTorch version and test if the same issue occurs.
Could you please tell me how/which version to downgrade to?
I have the following from my pip list:
torch 2.4.0+cu121
torchaudio 2.4.0+cu121
torchmetrics 1.4.0.post0
torchsde 0.2.6
torchvision 0.19.0+cu121
When I launch without any nodes, it doesn't crash the audio.
I still get this warning though:
C:\AI\ComfyUI\venv\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)
I'll do some split-tests until I find the node/s causing the issue.
Remove them and try this.
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
If this method doesn't resolve the issue, I recommend also trying to reinstall the drivers.
I'll try that.
I have isolated the audio driver crash to these 2 node packs: https://github.com/dchatel/comfyui_facetools https://github.com/chflame163/ComfyUI_LayerStyle
Minor note: LayerStyle was working fine in my previous installation. Facetools I had already disabled for one reason or another. I don't remember. But it wasn't an audio driver crash for sure.
Remove them and try this.
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
If this method doesn't resolve the issue, I recommend also trying to reinstall the drivers.
After reinstalling torch like this:
Activating virtual environment...
Virtual environment activated.
(venv) C:\AI\ComfyUI>pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
Looking in indexes: https://download.pytorch.org/whl/cu121
Collecting torch==2.3.1
Downloading https://download.pytorch.org/whl/cu121/torch-2.3.1%2Bcu121-cp310-cp310-win_amd64.whl (2423.5 MB)
ββββββββββββββββββββββββββββββββββββββββ 2.4/2.4 GB 2.9 MB/s eta 0:00:00
Collecting torchvision==0.18.1
Downloading https://download.pytorch.org/whl/cu121/torchvision-0.18.1%2Bcu121-cp310-cp310-win_amd64.whl (5.7 MB)
ββββββββββββββββββββββββββββββββββββββββ 5.7/5.7 MB 40.5 MB/s eta 0:00:00
Collecting torchaudio==2.3.1
Downloading https://download.pytorch.org/whl/cu121/torchaudio-2.3.1%2Bcu121-cp310-cp310-win_amd64.whl (4.1 MB)
ββββββββββββββββββββββββββββββββββββββββ 4.1/4.1 MB 37.2 MB/s eta 0:00:00
Requirement already satisfied: filelock in c:\ai\comfyui\venv\lib\site-packages (from torch==2.3.1) (3.15.4)
Requirement already satisfied: typing-extensions>=4.8.0 in c:\ai\comfyui\venv\lib\site-packages (from torch==2.3.1) (4.12.2)
Requirement already satisfied: sympy in c:\ai\comfyui\venv\lib\site-packages (from torch==2.3.1) (1.13.1)
Requirement already satisfied: networkx in c:\ai\comfyui\venv\lib\site-packages (from torch==2.3.1) (3.3)
Requirement already satisfied: jinja2 in c:\ai\comfyui\venv\lib\site-packages (from torch==2.3.1) (3.1.4)
Requirement already satisfied: fsspec in c:\ai\comfyui\venv\lib\site-packages (from torch==2.3.1) (2024.5.0)
Collecting mkl<=2021.4.0,>=2021.1.1 (from torch==2.3.1)
Downloading https://download.pytorch.org/whl/mkl-2021.4.0-py2.py3-none-win_amd64.whl (228.5 MB)
ββββββββββββββββββββββββββββββββββββββββ 228.5/228.5 MB 21.8 MB/s eta 0:00:00
Requirement already satisfied: numpy in c:\ai\comfyui\venv\lib\site-packages (from torchvision==0.18.1) (1.26.4)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\ai\comfyui\venv\lib\site-packages (from torchvision==0.18.1) (9.5.0)
Collecting intel-openmp==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch==2.3.1)
Downloading https://download.pytorch.org/whl/intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl (3.5 MB)
ββββββββββββββββββββββββββββββββββββββββ 3.5/3.5 MB 37.3 MB/s eta 0:00:00
Collecting tbb==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch==2.3.1)
Downloading https://download.pytorch.org/whl/tbb-2021.11.0-py3-none-win_amd64.whl (298 kB)
ββββββββββββββββββββββββββββββββββββββββ 298.3/298.3 kB ? eta 0:00:00
Requirement already satisfied: MarkupSafe>=2.0 in c:\ai\comfyui\venv\lib\site-packages (from jinja2->torch==2.3.1) (2.1.5)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\ai\comfyui\venv\lib\site-packages (from sympy->torch==2.3.1) (1.3.0)
Installing collected packages: tbb, intel-openmp, mkl, torch, torchvision, torchaudio
Attempting uninstall: torch
Found existing installation: torch 2.4.0+cu121
Uninstalling torch-2.4.0+cu121:
Successfully uninstalled torch-2.4.0+cu121
Attempting uninstall: torchvision
Found existing installation: torchvision 0.19.0+cu121
Uninstalling torchvision-0.19.0+cu121:
Successfully uninstalled torchvision-0.19.0+cu121
Attempting uninstall: torchaudio
Found existing installation: torchaudio 2.4.0+cu121
Uninstalling torchaudio-2.4.0+cu121:
Successfully uninstalled torchaudio-2.4.0+cu121
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ultralyticsplus 0.1.0 requires protobuf<3.21,>=3.20, but you have protobuf 4.25.4 which is incompatible.
Successfully installed intel-openmp-2021.4.0 mkl-2021.4.0 tbb-2021.11.0 torch-2.3.1+cu121 torchaudio-2.3.1+cu121 torchvision-0.18.1+cu121
I no longer have this warning:
C:\AI\ComfyUI\venv\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)
But when I try to launch with facetools in, I get this error:
Traceback (most recent call last):
File "C:\AI\ComfyUI\main.py", line 264, in <module>
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
File "C:\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "C:\AI\ComfyUI\main.py", line 159, in run
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
File "C:\AI\ComfyUI\server.py", line 677, in start
await site.start()
File "C:\AI\ComfyUI\venv\lib\site-packages\aiohttp\web_runner.py", line 119, in start
self._server = await loop.create_server(
File "C:\Python310\lib\asyncio\base_events.py", line 1513, in create_server
raise OSError(err.errno, 'error while attempting '
OSError: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8188): only one usage of each socket address (protocol/network address/port) is normally permitted
And LayerStyle gives me this error:
Activating virtual environment...
Virtual environment activated.
Initializing ComfyUI
Total VRAM 24576 MB, total RAM 64727 MB
pytorch version: 2.3.1+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: C:\AI\ComfyUI\web
# πΊdzNodes: LayerStyle -> Cannot import name 'guidedFilter' from 'cv2.ximgproc'
A few nodes cannot works properly, while most nodes are not affected. Please REINSTALL package 'opencv-contrib-python'.
For detail refer to https://github.com/chflame163/ComfyUI_LayerStyle/issues/5
# πΊdzNodes: LayerStyle -> Warning: C:\AI\ComfyUI\custom_nodes\ComfyUI_LayerStyle\resource_dir.ini not found, default directory to be used.
# πΊdzNodes: LayerStyle -> Find 1 LUTs in C:\AI\ComfyUI\custom_nodes\ComfyUI_LayerStyle\lut
# πΊdzNodes: LayerStyle -> Find 1 Fonts in C:\AI\ComfyUI\custom_nodes\ComfyUI_LayerStyle\font
Import times for custom nodes:
0.0 seconds: C:\AI\ComfyUI\custom_nodes\websocket_image_save.py
2.9 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI_LayerStyle
Traceback (most recent call last):
File "C:\AI\ComfyUI\main.py", line 264, in <module>
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
File "C:\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "C:\AI\ComfyUI\main.py", line 159, in run
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
File "C:\AI\ComfyUI\server.py", line 677, in start
await site.start()
File "C:\AI\ComfyUI\venv\lib\site-packages\aiohttp\web_runner.py", line 119, in start
self._server = await loop.create_server(
File "C:\Python310\lib\asyncio\base_events.py", line 1513, in create_server
raise OSError(err.errno, 'error while attempting '
OSError: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8188): only one usage of each socket address (protocol/network address/port) is normally permitted
I never did see these errors before, in my original launching console log.
Both still crash the audio drivers.
All other comfy terminals were closed. I'll try a reboot to make sure.
That error means there's an instance of ComfyUI running somewhere that you're not aware of. Close all terminals and open a new terminal to test it.
If it's not resolved, it's possible that the socket is indeed occupied by another program, so try testing with a completely different port allocation, like --port 7111.
And when testing, do so with all other custom nodes deactivated.
After rebooting, it does no longer show that error message.
The audio crash is still present. The error message appears to have been unrelated.
I am testing with only https://github.com/dchatel/comfyui_facetools or https://github.com/chflame163/ComfyUI_LayerStyle individually, one at a time.
They both launch as expected without any error messages.
The port error was happening because you already had a ComfyUI instance running. Which git commit are you on for your version of ComfyUI? Can you see if you audio driver still crashes when you don't have any custom nodes installed?
The port error was happening because you already had a ComfyUI instance running. Which git commit are you on for your version of ComfyUI? Can you see if you audio driver still crashes when you don't have any custom nodes installed?
Yeah. It must have remained even though I had closed all comfy CMD windows. A restart fixed this part with the instances.
I'm not 100% sure how to check which version I'm on. Is this the information you are asking for:
C:\AI\ComfyUI>git show
commit c75b50607b4ab78ef9c7c5c9e0c8672146ead91b (HEAD -> master, origin/master, origin/HEAD)
Author: comfyanonymous <comfyanonymous@protonmail.com>
Date: Mon Jul 29 11:15:37 2024 -0400
Less confusing exception if pillow() function fails.
diff --git a/node_helpers.py b/node_helpers.py index fee6287..4b38bff 100644 --- a/node_helpers.py +++ b/node_helpers.py @@ -25,7 +25,7 @@ def pillow(fn, arg): finally: if prev_value is not None: ImageFile.LOAD_TRUNCATED_IMAGES = prev_value
return x
def hasher(): hashfuncs = {
The port error was happening because you already had a ComfyUI instance running. Which git commit are you on for your version of ComfyUI? Can you see if you audio driver still crashes when you don't have any custom nodes installed?
- Yeah. It must have remained even though I had closed all comfy CMD windows. A restart fixed this part with the instances.
- I'm not 100% sure how to check which version I'm on. Is this the information you are asking for:
C:\AI\ComfyUI>git show commit c75b50607b4ab78ef9c7c5c9e0c8672146ead91b (HEAD -> master, origin/master, origin/HEAD) Author: comfyanonymous <comfyanonymous@protonmail.com> Date: Mon Jul 29 11:15:37 2024 -0400 Less confusing exception if pillow() function fails. diff --git a/node_helpers.py b/node_helpers.py index fee6287..4b38bff 100644 --- a/node_helpers.py +++ b/node_helpers.py @@ -25,7 +25,7 @@ def pillow(fn, arg): finally: if prev_value is not None: ImageFile.LOAD_TRUNCATED_IMAGES = prev_value - return x + return x def hasher(): hashfuncs = {
- It does not appear to crash if I have no custom nodes installed, or if I have 94 other custom node packs installed that work just fine. It only (and always) crashes, if I have either facetools or layerstyle in my custom_nodes folder.
In that case, it seems this should be handled in the relevant repository rather than the ComfyUI repo.
Remove them and try this.
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
If this method doesn't resolve the issue, I recommend also trying to reinstall the drivers.
This worked for me too. βοΈ
Remove them and try this.
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
If this method doesn't resolve the issue, I recommend also trying to reinstall the drivers.
This worked for me too. βοΈ
What problem were you having? Crashed audio drivers or something else?
Remove them and try this.
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
If this method doesn't resolve the issue, I recommend also trying to reinstall the drivers.
This worked for me too. βοΈ
What problem were you having? Crashed audio drivers or something else?
I encountered a warning when installing ComfyUI manually (as I always installed it in the past, nothing special). When you do a Google search for the warning, this thread comes up as the first link:
This is how I stumbled upon this thread.
Only ComfyUI and Manager were installed at the time, it was a clean Conda environment, nothing there except python (and dependencies for the aforementioned two).
Do you need exact commands I used?
Expected Behavior
For my sound driver to remain uncrashed :)
Actual Behavior
When launching ComfyUI, the sound driver apparently crashes. It affects both playing music, and videos.
Steps to Reproduce
Launch the program using my setup.
Debug Logs
Other
I cannot find anything relevant, and I don't think it's about this node specifically. It crashes even if I don't have any custom nodes installed.
It started happening a few days ago. I did a clean checkout and it also happens there.