From b838c367209a8530dc1c56c4150988a1d8af7ed6 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Thu, 22 May 2025 08:08:36 -0400 Subject: [PATCH 1/2] remove mtl from 3d model file list (#8192) --- comfy_extras/nodes_load_3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_extras/nodes_load_3d.py b/comfy_extras/nodes_load_3d.py index d5b4d9111aa..40d03e18abc 100644 --- a/comfy_extras/nodes_load_3d.py +++ b/comfy_extras/nodes_load_3d.py @@ -16,7 +16,7 @@ def INPUT_TYPES(s): os.makedirs(input_dir, exist_ok=True) - files = [normalize_path(os.path.join("3d", f)) for f in os.listdir(input_dir) if f.endswith(('.gltf', '.glb', '.obj', '.mtl', '.fbx', '.stl'))] + files = [normalize_path(os.path.join("3d", f)) for f in os.listdir(input_dir) if f.endswith(('.gltf', '.glb', '.obj', '.fbx', '.stl'))] return {"required": { "model_file": (sorted(files), {"file_upload": True}), From 4202e956a0172178f5d4ce1971da8c07c93420a9 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Thu, 22 May 2025 05:11:13 -0700 Subject: [PATCH 2/2] Add append feature to conditioning_set_values (#8239) Refactor unclipconditioning node. --- node_helpers.py | 10 ++++++++-- nodes.py | 11 +---------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/node_helpers.py b/node_helpers.py index c3e1a14ca5d..4ff960ef8af 100644 --- a/node_helpers.py +++ b/node_helpers.py @@ -5,12 +5,18 @@ 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 diff --git a/nodes.py b/nodes.py index 95e831b8b43..1e328651bb7 100644 --- a/nodes.py +++ b/nodes.py @@ -1103,16 +1103,7 @@ def apply_adm(self, conditioning, clip_vision_output, strength, noise_augmentati if strength == 0: return (conditioning, ) - c = [] - for t in conditioning: - o = t[1].copy() - x = {"clip_vision_output": clip_vision_output, "strength": strength, "noise_augmentation": noise_augmentation} - if "unclip_conditioning" in o: - o["unclip_conditioning"] = o["unclip_conditioning"][:] + [x] - else: - o["unclip_conditioning"] = [x] - n = [t[0], o] - c.append(n) + c = node_helpers.conditioning_set_values(conditioning, {"unclip_conditioning": [{"clip_vision_output": clip_vision_output, "strength": strength, "noise_augmentation": noise_augmentation}]}, append=True) return (c, ) class GLIGENLoader: