Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
38.83k stars 5.01k forks source link

Lightning compatibility fix #281

Open alihassanijr opened 1 year ago

alihassanijr commented 1 year ago

Hello,

I'm unsure if this repository is still maintained, but I had to resolve this on my own so I figured I'd open a PR as well in case it still is maintained.

Due to a change in lightning's tree structure there will be an import failure if someone has to upgrade lighting, which was the case for me. This commit just changes that one import line and attempt to import assuming it's the new version, and if it fails it'll fall back to trying to import the old one.

soulteary commented 9 months ago

@rromb , @hardmaru , could this can merge?

If this change wants to be merged, is there anything else that needs to be done?

If it completes the merge, the downstream repository can normally use the complete PyTorch. 2.x software and obtain higher performance. For example: Stable Diffusion WebUI, etc.

refs: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14665