-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[LoRA] Add LoRA support to AuraFlow #10216
base: main
Are you sure you want to change the base?
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
da41f32
to
c8364bc
Compare
Thanks for the helping hand, @hlky! |
See https://github.com/huggingface/diffusers/blob/main/tests/lora/test_lora_layers_flux.py https://github.com/huggingface/diffusers/blob/main/tests/lora/test_lora_layers_mochi.py etc as an example for tests. Seems to be missing |
20b5f2d
to
80ac0d4
Compare
@sayakpaul Okay; I'm at a point where I've got actual, valid test failures but have no idea where to look. |
912fb8d
to
f5b9f90
Compare
Here's the log after the latest commit: pytest.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I have left some comments to fix a couple of things. LMK if they're unclear.
@classmethod | ||
@validate_hf_hub_args | ||
# Copied from diffusers.loaders.lora_pipeline.StableDiffusionLoraLoaderMixin.lora_state_dict | ||
def lora_state_dict( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't think we need to copy-paste it from StableDiffusionLoraLoaderMixin
.
It should be copy-pasted from
diffusers/src/diffusers/loaders/lora_pipeline.py
Line 1149 in a5f35ee
def lora_state_dict( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leads to the following test failure:
FAILED tests/lora/test_lora_layers_af.py::AuraFlowLoRATests::test_unexpected_keys_warning - ValueError: too many values to unpack (expected 2)
safe_serialization=safe_serialization, | ||
) | ||
|
||
def fuse_lora( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be accompanied with a # Copied from ...
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was in the previous PR; do you know where it was copied from?
components=components, lora_scale=lora_scale, safe_fusing=safe_fusing, adapter_names=adapter_names | ||
) | ||
|
||
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
f5b9f90
to
1c79095
Compare
Latest test log. |
What does this PR do?
This PR is a simple rebase of #9017
cc @sayakpaul for review.
Fixes # (issue)
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.