You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Support QwenImageEditPlus series attention mask for NPU #13016
Since PR #12702 introduced the attention mask to QwenImageEditPlus Series, the current _native_npu backend attention implementation does not support passing in the attention mask, which causes an error.
raiseValueError("`attn_mask` is not supported for NPU attention")
ifreturn_lse:
raiseValueError("NPU attention backend does not support setting `return_lse=True`.")
We would like to enable NPU support for QwenImageEditPlus. Based on a printed check, the mask currently contains all 1s (full attention). Is it possible to use a workaround to bypass this limitation so that Qwen-Image-Edit-Plus can run normally on the NPU?
Solution
The npu_fusion_attention function supports several shapes of attention masks. We need to add a check to verify if the attention_mask is supported by the NPU backend:
If the mask consists entirely of 1s (indicating full attention), we can pass None as the attention_mask to implement full attention in FA.
Otherwise, we should refer to the official documentation to add a validation check and determine whether the attention mask is valid for npu_fusion_attention.
Activity
muziyuhui666 commentedon Jan 24, 2026
I have also encountered this error on the NPU when using the latest version of diffusers (version 0.37.0.dev0).
zhangtao0408 commentedon Jan 24, 2026
Cherry-pick #13017