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

Canny preprocessor node does not work when using DirectML #1648

Open
rabidcopy opened this issue Oct 1, 2023 · 4 comments
Open

Canny preprocessor node does not work when using DirectML #1648

rabidcopy opened this issue Oct 1, 2023 · 4 comments

Comments

@rabidcopy
Copy link

rabidcopy commented Oct 1, 2023

Windows + RX 570, 2ef459b

python main.py --dont-upcast-attention --fp16-vae --use-quad-cross-attention --normalvram --disable-smart-memory --preview-method auto --directml
Using directml with device:
Total VRAM 1024 MB, total RAM 16335 MB
Set vram state to: NORMAL_VRAM
Disabling smart memory management
Device: privateuseone
VAE dtype: torch.float16
disabling upcasting of attention
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention111

Import times for custom nodes:
   0.0 seconds: C:\Users\zatoc\Desktop\ComfyUI\custom_nodes\sampler_tonemap.py
   0.0 seconds: C:\Users\zatoc\Desktop\ComfyUI\custom_nodes\sampler_rescalecfg.py
   0.0 seconds: C:\Users\zatoc\Desktop\ComfyUI\custom_nodes\sampler_tonemap_rescalecfg.py
   0.0 seconds: C:\Users\zatoc\Desktop\ComfyUI\custom_nodes\sdxl_model_merging.py
   0.0 seconds: C:\Users\zatoc\Desktop\ComfyUI\custom_nodes\advanced_model_merging.py

Starting server

To see the GUI go to: http://127.0.0.1:8188
got prompt
!!! Exception during processing !!!
Traceback (most recent call last):
  File "C:\Users\zatoc\Desktop\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "C:\Users\zatoc\Desktop\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "C:\Users\zatoc\Desktop\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "C:\Users\zatoc\Desktop\ComfyUI\comfy_extras\nodes_canny.py", line 293, in detect_edge
    output = canny(image.to(comfy.model_management.get_torch_device()).movedim(-1, 1), low_threshold, high_threshold)
  File "C:\Users\zatoc\Desktop\ComfyUI\comfy_extras\nodes_canny.py", line 248, in canny
    edges: Tensor = F.threshold(magnitude, low_threshold, 0.0)
  File "C:\Users\zatoc\Desktop\ComfyUI\venv\lib\site-packages\torch\nn\functional.py", line 1427, in _threshold
    result = _VF.threshold(input, threshold, value)
RuntimeError: The parameter is incorrect.

Downgrading just nodes_canny.py from d70b0bc to bdba394 makes it work, assumedly because it is not running on the GPU and running into this issue with DirectML.

@MythicalChu
Copy link

MythicalChu commented Oct 1, 2023

I'm on DirectML with a RX 580 8Gb and it's working just fine (Windows too). My ComfyUI is updated to just a few days ago, also, I'm not using any of the flags you are on start up. Maybe one of them is causing your problem?

@rabidcopy
Copy link
Author

rabidcopy commented Oct 1, 2023

I'm on DirectML with a RX 580 8Gb and it's working just fine (Windows too). My ComfyUI is updated to just a few days ago, also, I'm not using any of the flags you are on start up. Maybe one of them is causing your problem?

Still throws the error when running just python main.py --directml on latest commit.

image

@Lorg0n
Copy link

Lorg0n commented Oct 5, 2023

Hmmm, weird. I have a rx570 8gb and everything works fine.

@drago87
Copy link

drago87 commented Oct 27, 2023

Having the same problem on a RX 5700 XT 8gb

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