-
Notifications
You must be signed in to change notification settings - Fork 2.6k
LoRA refactor to enable FLUX control LoRAs w/ quantized tranformers #7446
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
Merged
Conversation
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
b9da053
to
54d5a46
Compare
14 tasks
54d5a46
to
a05642c
Compare
6 tasks
6c3281c
to
c358a63
Compare
a05642c
to
c407a25
Compare
hipsterusername
approved these changes
Dec 17, 2024
… LoRALayer or ConcatenatedLoRALayer patch types (since these are the most common).
…yers used by FLUX structural control LoRAs.
…uxControlLoRALayer type.
…tching methods and are not LoRA-specific.
…odelPatcher definition.
c407a25
to
dd09509
Compare
RyanJDick
added a commit
that referenced
this pull request
Dec 17, 2024
## Summary Add the ability to control the weight of a FLUX Control LoRA. ## Example Original image: <div style="display: flex; gap: 10px;"> <img src="https://github.com/user-attachments/assets/4a2d9f4a-b58b-4df6-af90-67b018763a38" alt="Image 1" width="300"/> </div> Prompt: `a scarecrow playing tennis` Weights: 0.4, 0.6, 0.8, 1.0 <div style="display: flex; gap: 10px;"> <img src="https://github.com/user-attachments/assets/62b83fd6-46ce-460a-8d51-9c2cda9b05c9" alt="Image 1" width="300"/> <img src="https://github.com/user-attachments/assets/75442207-1538-46bc-9d6b-08ac5c235c93" alt="Image 2" width="300"/> </div> <div style="display: flex; gap: 10px;"> <img src="https://github.com/user-attachments/assets/4a9dc9ea-9757-4965-837e-197fc9243007" alt="Image 1" width="300"/> <img src="https://github.com/user-attachments/assets/846f6918-ca82-4482-8c19-19172752fa8c" alt="Image 2" width="300"/> </div> ## QA Instructions - [x] weight control changes strength of control image - [x] Test that results match across both quantized and non-quantized. ## Merge Plan **_Do not merge this PR yet._** 1. Merge #7450 2. Merge #7446 3. Change target branch to main 4. Merge this branch. ## Checklist - [ ] _The PR has a short but descriptive title, suitable for a changelog_ - [ ] _Tests added / updated (if applicable)_ - [ ] _Documentation added / updated (if applicable)_ - [ ] _Updated `What's New` copy (if doing a release after this PR)_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend
PRs that change backend files
invocations
PRs that change invocations
python
PRs that change python files
python-tests
PRs that change python tests
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.
Summary
This PR refactors the LoRA handling code to enable the use of FLUX control LoRAs on top of quantized transformers.
Changes:
ONNXModelPatcher
. It is out-of-date and hasn't been used in a while.QA Instructions
I completed the following tests.
These should be repeated after changing the target branch to main.
Due to the large surface area of this PR, reviewers should do regression tests on a range of LoRA formats. There is a risk of regression on a specific format that was missed during the refactoring.
Merge Plan
Don't merge this PR yet.
Merge plan:
Checklist
What's New
copy (if doing a release after this PR)