Add a ControlNetApplyAdvanced node.

The controlnet can be applied to the positive or negative prompt only by
connecting it correctly.
This commit is contained in:
comfyanonymous
2023-07-24 13:26:07 -04:00
parent 0240946ecf
commit d191c4f9ed
2 changed files with 50 additions and 1 deletions

View File

@@ -607,7 +607,7 @@ class KSampler:
for c in negative:
create_cond_with_same_area_if_none(positive, c)
apply_empty_x_to_equal_area(positive, negative, 'control', lambda cond_cnets, x: cond_cnets[x])
apply_empty_x_to_equal_area(list(filter(lambda c: c[1].get('control_apply_to_uncond', False) == True, positive)), negative, 'control', lambda cond_cnets, x: cond_cnets[x])
apply_empty_x_to_equal_area(positive, negative, 'gligen', lambda cond_cnets, x: cond_cnets[x])
if self.model.is_adm():