Skip to content
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

Add LCM scheduler #320

Merged
merged 4 commits into from
Dec 22, 2023
Merged

Add LCM scheduler #320

merged 4 commits into from
Dec 22, 2023

Conversation

wtedw
Copy link
Contributor

@wtedw wtedw commented Dec 19, 2023

This is a simple version of LCMScheduler that supports txt2img.
Here's a livebook that makes use of the scheduler:

To support LCM-LoRA natively in Axon + Bumblebee, we'd need these PRs

  • Load lora weights from Bumblebee
  • Add LoRA support to Axon? or keep separate. Right now it's using my own library to load LoRA .safetensors

also, seed + strength should be forwarded to the scheduler_init function, but I'll create a separate PR for this.

@josevalim
Copy link
Contributor

I believe @seanmor5 wants LoRA support in Axon. :)

@jonatanklosko
Copy link
Member

@wtedw thanks a lot for the PR! I'm doing minor some adjustments and docs, will push and merge tomorrow :)

seed + strength should be forwarded to the scheduler_init function

Good call, we should pass the prng key when calling any of the schedulers, I will change it afterwards. The strength is only relevant for img2img, so we can wait until we support it before we expose it.

@wtedw
Copy link
Contributor Author

wtedw commented Dec 21, 2023

@jonatanklosko , Awesome thanks!

@jonatanklosko
Copy link
Member

Btw. we will need a separate serving for LCM Diffusion, corresponding to LatentConsistencyModelPipeline in hf/diffusers. There are some differences from Stable Diffusion, in particular LCM doesn't really support negative prompt and the guidance scale is incorporated into the U-Net forward pass as additional timestamp embeddings (which is likely why using different guiding scales didn't work very well for you). But we will get to this once we support loading LoRA!

@jonatanklosko jonatanklosko changed the title Add LCM scheduler for txt2img Add LCM scheduler Dec 22, 2023
@jonatanklosko jonatanklosko merged commit a1d2e86 into elixir-nx:main Dec 22, 2023
2 checks passed
@wtedw
Copy link
Contributor Author

wtedw commented Dec 27, 2023

@jonatanklosko Ah that's some good info. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants