1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

Add append feature to conditioning_set_values (#8239)

Refactor unclipconditioning node.
This commit is contained in:
comfyanonymous
2025-05-22 05:11:13 -07:00
committed by GitHub
parent b838c36720
commit 4202e956a0
2 changed files with 9 additions and 12 deletions

View File

@@ -5,12 +5,18 @@ from comfy.cli_args import args
from PIL import ImageFile, UnidentifiedImageError
def conditioning_set_values(conditioning, values={}):
def conditioning_set_values(conditioning, values={}, append=False):
c = []
for t in conditioning:
n = [t[0], t[1].copy()]
for k in values:
n[1][k] = values[k]
val = values[k]
if append:
old_val = n[1].get(k, None)
if old_val is not None:
val = old_val + val
n[1][k] = val
c.append(n)
return c