-
Notifications
You must be signed in to change notification settings - Fork 36
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
SDTurbo - 'MultiHeadAttention_0' Failed to run JSEP kernel #13
Comments
EDIT: This was some unrelated error, but was still outputing the same error message |
It looks like there's at least one issue with MultiHeadAttention kernel. There's a temp fix for that which runs unet twice for prompt and negative prompt https://github.com/gfodor/diffusers.js/tree/optimum-sdxl |
Thank you for the quick feedback! I'll give it a try. Here's the exported model: https://huggingface.co/cyrildiagne/sdturbo-onnx |
Hmm, I cleared my indexedDB and the problem is gone. So I guess I was using an early, broken export. |
@cyrildiagne Hello, I saw that you were able to implement SD Turbo. Nice work! I was trying to do the same thing but I got stuck on a similar error when running the UNET model which was this: I was able to avoid this error by switching the backend to WASM but when I did that the UNET gave me NANs as output and the final image was a black image. I used the following command to convert the model to ONNX:
My converted model can be found here Other relevant information:
Not sure if my issue is with the converted model or something else but I wanted to know if it was possible if you could help me with this. Any assistance would be appreciated. Thank you! |
Hi @jdp8 , do you also have the problem when using https://huggingface.co/cyrildiagne/sdturbo-onnx ? |
Yes this model doesn't do CFG so it expects no negative prompt so the I assume that the issue with steps<=2 comes from using the PNDM scheduler? I plan to do a PR that adds SDTurbo support along with my EulerDiscreteScheduler implementation. But have to re-adapt it a bit to this codebase first since I diverged a bit from it during experimentation. In the meantime here's the step function in case it's helpful:
|
Yes you are correct, I was using the PNDM Scheduler instead of my implementation of the EulerDiscreteScheduler. But there must be something wrong with my implementation of the scheduler because I get a black image at the end. More than likely the issue is in my I'll wait for your PR so as not to take more time from you. Thank you for your assistance, very much appreciated! |
@jdp8 I've started a draft PR here. It's still WIP & needs cleaning but the relevant code should be there (it works in the react example app) |
Awesome, thank you so much! I'll test it out and look into it to see if I can help with anything else. |
Hi!
Thank you for this great work.
I'm trying to run SDTurbo with diffusers.js.
I've followed the instructions from this issue to export the model to ONNX.
Full log of the export
Everything seems to export and load properly in the browser with
webgpu
. And I'm also able to run the text-encoder & vae-decoder of the exported model with webgpu without issue.However, when I try to run a step of the unet, I get this error:
It's not clear why this operator fails as it seems supported & running fine in sd21. Is it a known issue? Any pointer would be welcome!
The text was updated successfully, but these errors were encountered: