Skip to content

Commit 5ba7330

Browse files
authored
Merge branch 'master' into master
2 parents 0120eb6 + 3f77450 commit 5ba7330

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

comfy/sd.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,15 +1736,16 @@ def load_diffusion_model_state_dict(sd, model_options={}, metadata=None, disable
17361736
"""
17371737
dtype = model_options.get("dtype", None)
17381738

1739+
custom_operations = model_options.get("custom_operations", None)
1740+
if custom_operations is None:
1741+
sd, metadata = comfy.utils.convert_old_quants(sd, "", metadata=metadata)
1742+
17391743
#Allow loading unets from checkpoint files
17401744
diffusion_model_prefix = model_detection.unet_prefix_from_state_dict(sd)
17411745
temp_sd = comfy.utils.state_dict_prefix_replace(sd, {diffusion_model_prefix: ""}, filter_keys=True)
17421746
if len(temp_sd) > 0:
17431747
sd = temp_sd
17441748

1745-
custom_operations = model_options.get("custom_operations", None)
1746-
if custom_operations is None:
1747-
sd, metadata = comfy.utils.convert_old_quants(sd, "", metadata=metadata)
17481749
parameters = comfy.utils.calculate_parameters(sd)
17491750
weight_dtype = comfy.utils.weight_dtype(sd)
17501751

0 commit comments

Comments
 (0)