UNet not predicting noise correctly in Stable Diffusion #262
Unanswered
DisableGraphics
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all, I've decided to open a discussion because the problem isn't with ort per se. I've had the same errors in C++ with onnx. However, I'm primarily using ort as my project's library, so I'd like to have insight with ort. (BTW, this is why I opened a discussion, not an issue)
I'm trying to implement stable diffusion from scratch using ort. However, for some bizarre reason that transcends my limited knowledge of ML, the unet is not predicting noise correctly. I've tested everything three bajillion times and I know there's nothing wrong with any model (except this thing with the UNet) nor the scheduler (that's why I'm not posting it, but for the interested I'm using the scheduler from pyke's diffusers repo: https://github.com/pykeio/diffusers with some modifications (it just returns the prev_sample instead of the whole SchedulerOutput struct)).
I know it's not predicting correctly the noise because I've used onnxruntime's C# version of stable diffusion (https://github.com/cassiebreviu/StableDiffusion) to benchmark mine against and the noise prediction array is completely different from mine.
Here's my diffusion loop:
I'm using the latest version of ort (
ort = { git = "https://github.com/pykeio/ort", branch = "main", default-features = false, features = ["ndarray", "download-binaries"] }
)The latents look like this after each iteration:
0
1
2
3
4
Here's the noise prediction after each iteration:
0
1
2
3
4
Beta Was this translation helpful? Give feedback.
All reactions