ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

ModuleNotFoundError: No module named 'torch_directml'

Open lilly1987 opened this issue 2 years ago • 4 comments

C:\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --directml

Prestartup times for custom nodes:
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyuiManager_v012

Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\ComfyUI\main.py", line 72, in <module>
    import execution
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 12, in <module>
    import nodes
  File "C:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 20, in <module>
    import comfy.diffusers_load
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\diffusers_load.py", line 4, in <module>
    import comfy.sd
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 5, in <module>
    from comfy import model_management
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 33, in <module>
    import torch_directml
ModuleNotFoundError: No module named 'torch_directml'

gpu : rx 6600 how to solv?

lilly1987 avatar Dec 15 '23 04:12 lilly1987

** ComfyUI startup time: 2023-12-15 13:14:58.765475
** Platform: Windows
** Python version: 3.11.6 (tags/v3.11.6:8b6ee5b, Oct  2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
** Python executable: C:\ComfyUI_windows_portable\python_embeded\python.exe
** Log path: C:\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes:
   0.0 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyuiManager_v012

Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\ComfyUI\main.py", line 72, in <module>
    import execution
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 12, in <module>
    import nodes
  File "C:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 20, in <module>
    import comfy.diffusers_load
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\diffusers_load.py", line 4, in <module>
    import comfy.sd
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 5, in <module>
    from comfy import model_management
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 33, in <module>
    import torch_directml
ModuleNotFoundError: No module named 'torch_directml'

lilly1987 avatar Dec 15 '23 04:12 lilly1987

https://github.com/comfyanonymous/ComfyUI?tab=readme-ov-file#directml-amd-cards-on-windows

ltdrdata avatar Dec 15 '23 04:12 ltdrdata

2023-12-15 13 57 03 how to install in embad?

lilly1987 avatar Dec 15 '23 04:12 lilly1987

"embad"?

Anyway first try to find a font for your editors that doesn't display a crossed out W instead of , you probably need to change the code page of the command prompt to UTF-8 or maybe just windows-1252 or whatever latin is. If 99% of the text is going to be english anyway there's no sense in keeping it set to korean and uglying up the pathnames. :-)

Second

pip uninstall torch-directml torch_directml_native torch_directml torch 
pip install torch-directml

Microsoft performed ugly hackery to make torch-directml kinda work, mostly they just ignored the "how to write a torch backend" guide and jammed their code in where they felt like it. You can't have an existing CPU or GPU torch installed when you install it or it won't work. You might have to remove torchvision and

NeedsMoar avatar Dec 17 '23 04:12 NeedsMoar

"embad"?

Anyway first try to find a font for your editors that doesn't display a crossed out W instead of , you probably need to change the code page of the command prompt to UTF-8 or maybe just windows-1252 or whatever latin is. If 99% of the text is going to be english anyway there's no sense in keeping it set to korean and uglying up the pathnames. :-)

Second

pip uninstall torch-directml torch_directml_native torch_directml torch 
pip install torch-directml

Microsoft performed ugly hackery to make torch-directml kinda work, mostly they just ignored the "how to write a torch backend" guide and jammed their code in where they felt like it. You can't have an existing CPU or GPU torch installed when you install it or it won't work. You might have to remove torchvision and

You're a savior. I was having tons of issues and it worked with removing all of the crap. :D

muriloa avatar Mar 02 '24 01:03 muriloa