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

[PEFT / LoRA ] Fix text encoder scaling #5204

Merged
merged 6 commits into from
Sep 29, 2023

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Sep 27, 2023

What does this PR do?

Addresses the first comment of #5151 (review)

1- removes the use_peft_backend argument from adjust_lora_scale_text_encoder
2- Calls scale_lora_layers / unscale_lora_layers on encode_prompt for StableDiffusionPipeline and StableDiffusionXLPipeline
3- make fix-copies

All tests pass and I made sure the generate image is the same with and without scale argument from main.

cc @patrickvonplaten @sayakpaul

@patrickvonplaten
Copy link
Contributor

PR looks good but many tests are failing - can you take a look here @younesbelkada ?

@younesbelkada
Copy link
Contributor Author

Thanks! Should be fixed now!

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this one once the tests are green

@patrickvonplaten patrickvonplaten merged commit cc92332 into huggingface:main Sep 29, 2023
10 of 11 checks passed
rchuzh99 pushed a commit to rchuzh99/diffusers that referenced this pull request Oct 4, 2023
* move text encoder changes

* fix

* add comment.

* fix tests

* Update src/diffusers/utils/peft_utils.py

---------

Co-authored-by: Patrick von Platen <[email protected]>
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* move text encoder changes

* fix

* add comment.

* fix tests

* Update src/diffusers/utils/peft_utils.py

---------

Co-authored-by: Patrick von Platen <[email protected]>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* move text encoder changes

* fix

* add comment.

* fix tests

* Update src/diffusers/utils/peft_utils.py

---------

Co-authored-by: Patrick von Platen <[email protected]>
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.

2 participants