Support loading AnyFlow embedder and weights as PEFT LoRA#7
Open
bghira wants to merge 1 commit into
Open
Conversation
Author
|
the resulting LoRA weights and a small patch file for use in eg. Diffusers: https://huggingface.co/bghira/AnyFlow-Wan2.1-T2V-1.3B-LoRA |
Collaborator
|
Thanks! I’ll review the PR this weekend. I’ll also release the official LoRA checkpoint if it would be helpful for users. |
Author
|
thanks yeah the lora approach is fundamentally sound for most end users especially continued training |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, thank you for the thorough source code release for AnyFlow. I've done work on several distillation methods that did not release their source code and this was a dream in comparison.
One thing that I noticed which really inhibits adoption of this is that the full transformer weights have to be downloaded; there's no extracted LoRA to use for inference post-hoc.
I put together a patched LoRA loader and extraction scripts to help downstream consumers address the gap here and make whatever size adapter is efficient for their use case. The LoRA contains the delta embedder weights, added manually, because the plain Wan 2.1 transformer didn't have them for the extraction script to naively pull the delta for.
If it's helpful, I can supply the extracted LoRA safetensors.
This code is all licensed Apache 2.0, the same as the rest of the repo. I didn't see any CLA required to sign for contributing, so I hope this is adequate.