Skip to content

Commit

Permalink
Add node to set only the conditioning area strength.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jan 29, 2024
1 parent 079dbf9 commit 9321198
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,26 @@ def append(self, conditioning, width, height, x, y, strength):
c.append(n)
return (c, )

class ConditioningSetAreaStrength:
@classmethod
def INPUT_TYPES(s):
return {"required": {"conditioning": ("CONDITIONING", ),
"strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
}}
RETURN_TYPES = ("CONDITIONING",)
FUNCTION = "append"

CATEGORY = "conditioning"

def append(self, conditioning, strength):
c = []
for t in conditioning:
n = [t[0], t[1].copy()]
n[1]['strength'] = strength
c.append(n)
return (c, )


class ConditioningSetMask:
@classmethod
def INPUT_TYPES(s):
Expand Down Expand Up @@ -1754,6 +1774,7 @@ def expand_image(self, image, left, top, right, bottom, feathering):
"ConditioningConcat": ConditioningConcat,
"ConditioningSetArea": ConditioningSetArea,
"ConditioningSetAreaPercentage": ConditioningSetAreaPercentage,
"ConditioningSetAreaStrength": ConditioningSetAreaStrength,
"ConditioningSetMask": ConditioningSetMask,
"KSamplerAdvanced": KSamplerAdvanced,
"SetLatentNoiseMask": SetLatentNoiseMask,
Expand Down

0 comments on commit 9321198

Please sign in to comment.