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

[Bug]: The Issue of y.shape[1] == 4 and Directml, a lack of torch.median() and the solution. #50

Open
MythicalChu opened this issue Mar 11, 2024 · 0 comments

Comments

@MythicalChu
Copy link

What happened?

Everyone on Directml will fail to use this node encountering the tuple error.

Steps to reproduce the problem

Be me.
Be everyone using DirectML.
???
Don't profit. Ever.

What should have happened?

Alpha Translucentiation

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

AMD, DirectML, Pain Incarnate.

Console logs

-

Workflow json file

Additional information

I had posted about this on forge's layerdiffuse and totally forgot, my bad. There I detail the exact cause of the problem and the workaround: lllyasviel/sd-forge-layerdiffuse#10 (comment)

tl;dr: on line 300 of lib_layerdiffusion\modesl.py , median = torch.median(result, dim=0).values FAILS. DirectML doesn't know torch.median() . The solution is to cast the previous line .to("cpu") and the next line back .to(self.load_device)

So, lines 299, 300, 301 look like this:
result = torch.stack(result, dim=0).to("cpu")
median = torch.median(result, dim=0).values
return median.to(self.load_device)

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

1 participant