From 1c1ccaa03ff233310fbe05c2af16f11982852ba2 Mon Sep 17 00:00:00 2001 From: Vishnu V Jaddipal <95531133+Gothos@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:43:43 +0530 Subject: [PATCH] Xlabs lora fix (#9348) * Fix ```from_single_file``` for xl_inpaint * Add basic flux inpaint pipeline * style, quality, stray print * Fix stray changes * Add inpainting model support * Change lora conversion for xlabs * Fix stray changes * Apply suggestions from code review * style --------- Co-authored-by: Sayak Paul --- src/diffusers/loaders/lora_conversion_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/diffusers/loaders/lora_conversion_utils.py b/src/diffusers/loaders/lora_conversion_utils.py index 4b54269479..f6dea33e8e 100644 --- a/src/diffusers/loaders/lora_conversion_utils.py +++ b/src/diffusers/loaders/lora_conversion_utils.py @@ -562,7 +562,8 @@ def _convert_xlabs_flux_lora_to_diffusers(old_state_dict): new_key += ".attn.to_out.0" elif "processor.proj_lora2" in old_key: new_key += ".attn.to_add_out" - elif "processor.qkv_lora1" in old_key and "up" not in old_key: + # Handle text latents. + elif "processor.qkv_lora2" in old_key and "up" not in old_key: handle_qkv( old_state_dict, new_state_dict, @@ -574,7 +575,8 @@ def _convert_xlabs_flux_lora_to_diffusers(old_state_dict): ], ) # continue - elif "processor.qkv_lora2" in old_key and "up" not in old_key: + # Handle image latents. + elif "processor.qkv_lora1" in old_key and "up" not in old_key: handle_qkv( old_state_dict, new_state_dict,