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

Support FLUX structural control LoRA models #7450

Merged
merged 19 commits into from
Dec 17, 2024

Conversation

RyanJDick
Copy link
Collaborator

@RyanJDick RyanJDick commented Dec 16, 2024

Summary

This PR adds support for the FLUX structural control LoRA models:

Note: Experimentally, the depth control model was found to be much more effective than the canny control model.

Left for future

Example flux1-depth-dev-lora

Input image:
image

Prompt: a scarecrow playing tennis
Output:
image

QA Instructions

  • The FLUX control LoRAs are recognized by the model probe.
  • Non-control LoRAs are still recognized by the model probe and are not falsely identified as control LoRAs.
  • FLUX Canny control LoRA
  • FLUX Depth control LoRA
  • Generation without a control LoRA
  • Control image with different shape than target image
  • Compatibility with IP-Adapter (runs, but quality isn't great)
  • Compatibility with other ControlNets (runs, but quality isn't great)
  • Compatibility with other LoRAs

Remaining TODOs

  • @psychedelicious Warn in the Linear UI if multiple Control LoRAs are active simultaneously - only 1 is supported.

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)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files frontend PRs that change frontend files python-tests PRs that change python tests labels Dec 16, 2024
@RyanJDick RyanJDick marked this pull request as ready for review December 17, 2024 03:29
@psychedelicious psychedelicious force-pushed the brandon/flux-tools-loras branch from 6c3281c to c358a63 Compare December 17, 2024 08:01
@hipsterusername hipsterusername merged commit 5f41a69 into main Dec 17, 2024
14 checks passed
@hipsterusername hipsterusername deleted the brandon/flux-tools-loras branch December 17, 2024 12:28
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 frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants