Skip to content

[SDXL Lora] Fix last ben sdxl lora #4797

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
merged 3 commits into from
Aug 26, 2023
Merged

Conversation

patrickvonplaten
Copy link
Contributor

What does this PR do?

Fixes: #4302

@patrickvonplaten
Copy link
Contributor Author

patrickvonplaten commented Aug 26, 2023

I ran all LoRAIntegration Tests:

RUN_SLOW=1 CUDA_VISIBLE_DEVICES="1" pytest tests/models/test_lora_layers.py::LoraIntegrationTests

and by lowering the precision a bit (to 5e-3) all tests pass. Merging this one now so that we don't run into too many merge conflicts with other PRs (cc @sayakpaul):

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 26, 2023

The documentation is not available anymore as the PR was closed or merged.

@@ -1201,12 +1218,8 @@ def _map_sgm_blocks_to_diffusers(cls, state_dict, unet_config, delimiter="_", bl
)
new_state_dict[new_key] = state_dict.pop(key)

if is_all_unet and len(state_dict) > 0:
if len(state_dict) > 0:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactor here a bit by moving "adding text encoder keys" further up to have stronger check/assert here

@patrickvonplaten patrickvonplaten merged commit c4d2823 into main Aug 26, 2023
@patrickvonplaten patrickvonplaten deleted the sdxl_lora_last_ben branch August 26, 2023 21:31
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* Fix last ben sdxl lora

* Correct typo

* make style
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* Fix last ben sdxl lora

* Correct typo

* make style
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.

load_lora_weight() doesn't work for sdxl lora trained model from https://github.com/TheLastBen/fast-stable-diffusion
2 participants