cassiebreviu / StableDiffusion

Inference Stable Diffusion with C# and ONNX Runtime
MIT License
218 stars 49 forks source link

Add EulerA scheduler #12

Closed jdluzen closed 1 year ago

jdluzen commented 1 year ago

Currently ~is borken~ works thanks to Cassie.

cassiebreviu commented 1 year ago

Fixed LMS scheduler and pushed changes here. SetTimeSteps needed to be set in the scheduler because it uses the global sigmas values.

cassiebreviu commented 1 year ago

@jdluzen Can you share the model you are using?

cassiebreviu commented 1 year ago

@jdluzen I was able to fix the euler scheduler and get it working on my model. Can you test on your model and let me know if it works for you?

jdluzen commented 1 year ago

It works! UINT8 quantized too! Did I port the wrong file? I was using the original 1.5 fp32.

cassiebreviu commented 1 year ago

Yay!! I am going to refactor the scheduler a bit in a new PR to main because I am also working on an EP config in main rather than having branches for each EP.

You didnt port the wrong file but there were issues in the math. Python and PyTorch handle some math operations and random generation differently than C# so it needs to be implemented different to work correctly.

Thanks!!