We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26ec30e commit 17960ccCopy full SHA for 17960cc
1 file changed
src/diffusers/loaders/peft.py
@@ -225,6 +225,12 @@ def load_lora_adapter(
225
if is_sai_sd_control_lora:
226
state_dict = convert_sai_sd_control_lora_state_dict_to_peft(state_dict)
227
228
+ # Auto-detect if the incoming state_dict expects fused QKV projections
229
+ # and fuse them in the model if the model supports it.
230
+ has_fused_qkv = any("to_qkv" in k for k in state_dict.keys())
231
+ if has_fused_qkv and hasattr(self, "fuse_qkv_projections"):
232
+ self.fuse_qkv_projections()
233
+
234
rank = {}
235
for key, val in state_dict.items():
236
# Cannot figure out rank from lora layers that don't have at least 2 dimensions.
0 commit comments