Skip to content

Commit 1b160df

Browse files
authored
Merge branch 'main' into main
2 parents 5f6733a + 1896b1f commit 1b160df

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/diffusers/loaders/unet.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,17 @@ def _process_lora(
343343
else:
344344
if is_peft_version("<", "0.9.0"):
345345
lora_config_kwargs.pop("use_dora")
346+
347+
if "lora_bias" in lora_config_kwargs:
348+
if lora_config_kwargs["lora_bias"]:
349+
if is_peft_version("<=", "0.13.2"):
350+
raise ValueError(
351+
"You need `peft` 0.14.0 at least to use `bias` in LoRAs. Please upgrade your installation of `peft`."
352+
)
353+
else:
354+
if is_peft_version("<=", "0.13.2"):
355+
lora_config_kwargs.pop("lora_bias")
356+
346357
lora_config = LoraConfig(**lora_config_kwargs)
347358

348359
# adapter_name

tests/lora/test_lora_layers_sd3.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
from diffusers.utils import load_image
3030
from diffusers.utils.import_utils import is_accelerate_available
3131
from diffusers.utils.testing_utils import (
32+
nightly,
3233
numpy_cosine_similarity_distance,
3334
require_peft_backend,
3435
require_torch_gpu,
36+
slow,
3537
torch_device,
3638
)
3739

@@ -126,6 +128,8 @@ def test_modify_padding_mode(self):
126128
pass
127129

128130

131+
@slow
132+
@nightly
129133
@require_torch_gpu
130134
@require_peft_backend
131135
class LoraSD3IntegrationTests(unittest.TestCase):

0 commit comments

Comments
 (0)