Skip to content

Commit 6e14aff

Browse files
committed
remove redundant checks
1 parent 45cf2db commit 6e14aff

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,6 @@ def __call__(
12821282
)
12831283

12841284
# 4. Prepare image
1285-
assert isinstance(controlnet, ControlNetUnionModel)
1286-
12871285
for image_type in image_list:
12881286
if image_list[image_type]:
12891287
image = self.prepare_image(
@@ -1447,18 +1445,17 @@ def __call__(
14471445
controlnet_cond_scale = controlnet_cond_scale[0]
14481446
cond_scale = controlnet_cond_scale * controlnet_keep[i]
14491447

1450-
if isinstance(controlnet, ControlNetUnionModel):
1451-
down_block_res_samples, mid_block_res_sample = self.controlnet(
1452-
control_model_input,
1453-
t,
1454-
encoder_hidden_states=controlnet_prompt_embeds,
1455-
controlnet_cond=image_list,
1456-
control_type=control_type,
1457-
conditioning_scale=cond_scale,
1458-
guess_mode=guess_mode,
1459-
added_cond_kwargs=controlnet_added_cond_kwargs,
1460-
return_dict=False,
1461-
)
1448+
down_block_res_samples, mid_block_res_sample = self.controlnet(
1449+
control_model_input,
1450+
t,
1451+
encoder_hidden_states=controlnet_prompt_embeds,
1452+
controlnet_cond=image_list,
1453+
control_type=control_type,
1454+
conditioning_scale=cond_scale,
1455+
guess_mode=guess_mode,
1456+
added_cond_kwargs=controlnet_added_cond_kwargs,
1457+
return_dict=False,
1458+
)
14621459

14631460
if guess_mode and self.do_classifier_free_guidance:
14641461
# Inferred ControlNet only for the conditional batch.

0 commit comments

Comments
 (0)