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

Fix for running via DirectML #6542

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hisham-hchowdhu
Copy link

Several fixes for running via DirectML
Fix empty image generation issue with Flux1
add CPU fallback for unsupported path. Verified the model works on AMD GPUs

Fix DirectML empty image generation issue with Flux1. add CPU fallback for unsupported path. Verified the model works on AMD GPUs
@Kosinkadink Kosinkadink added the AMD Issue related to AMD driver support. label Jan 27, 2025
causal_mask = torch.empty(x.shape[1], x.shape[1], dtype=x.dtype, device=x.device).fill_(-torch.finfo(x.dtype).max).triu_(1)
if comfy.model_management.is_directml_enabled():
causal_mask = torch.empty(x.shape[1], x.shape[1], dtype=x.dtype, device=x.device).triu_(1)
else:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change still needed on the latest code?

Copy link
Author

@hisham-hchowdhu hisham-hchowdhu Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, without this change image generated is blank

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't setting the causal mask correctly.

Does doing this work?

torch.full((x.shape[1], x.shape[1]), -torch.finfo(x.dtype).max, dtype=x.dtype, device=x.device).triu_(1)

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

Successfully merging this pull request may close these issues.

3 participants