Skip to content

Commit b7a6e34

Browse files
[From single file] Make sure that controlnet stays False for from_single_file (#4181)
* fix from signle file * Make sure converison always works with safetensors
1 parent 47b3346 commit b7a6e34

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ def convert_open_clip_checkpoint(
931931
continue
932932
if key[len(prefix) :] in textenc_conversion_map:
933933
if key.endswith("text_projection"):
934-
value = checkpoint[key].T
934+
value = checkpoint[key].T.contiguous()
935935
else:
936936
value = checkpoint[key]
937937

@@ -1285,9 +1285,7 @@ def download_from_original_stable_diffusion_ckpt(
12851285
if image_size is None:
12861286
image_size = 512
12871287

1288-
if controlnet is None:
1289-
controlnet = "control_stage_config" in original_config.model.params
1290-
1288+
if controlnet is None and "control_stage_config" in original_config.model.params:
12911289
controlnet = convert_controlnet_checkpoint(
12921290
checkpoint, original_config, checkpoint_path, image_size, upcast_attention, extract_ema
12931291
)

0 commit comments

Comments
 (0)