Skip to content

Commit 9afccbc

Browse files
committed
Merge branch 'main' into resolution-hotswap-tests
2 parents 2dc11a2 + f064b3b commit 9afccbc

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/diffusers/loaders/unet_loader_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import copy
1515
from typing import TYPE_CHECKING, Dict, List, Union
1616

17+
from torch import nn
18+
1719
from ..utils import logging
1820

1921

@@ -52,7 +54,7 @@ def _maybe_expand_lora_scales(
5254
weight_for_adapter,
5355
blocks_with_transformer,
5456
transformer_per_block,
55-
unet.state_dict(),
57+
model=unet,
5658
default_scale=default_scale,
5759
)
5860
for weight_for_adapter in weight_scales
@@ -65,7 +67,7 @@ def _maybe_expand_lora_scales_for_one_adapter(
6567
scales: Union[float, Dict],
6668
blocks_with_transformer: Dict[str, int],
6769
transformer_per_block: Dict[str, int],
68-
state_dict: None,
70+
model: nn.Module,
6971
default_scale: float = 1.0,
7072
):
7173
"""
@@ -154,6 +156,7 @@ def _maybe_expand_lora_scales_for_one_adapter(
154156

155157
del scales[updown]
156158

159+
state_dict = model.state_dict()
157160
for layer in scales.keys():
158161
if not any(_translate_into_actual_layer_name(layer) in module for module in state_dict.keys()):
159162
raise ValueError(

src/diffusers/schedulers/scheduling_scm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def set_timesteps(
168168
else:
169169
# max_timesteps=arctan(80/0.5)=1.56454 is the default from sCM paper, we choose a different value here
170170
self.timesteps = torch.linspace(max_timesteps, 0, num_inference_steps + 1, device=device).float()
171-
print(f"Set timesteps: {self.timesteps}")
172171

173172
self._step_index = None
174173
self._begin_index = None

0 commit comments

Comments
 (0)