From ef5c45afe394a3d072a34be6a2b59fd01b567d5d Mon Sep 17 00:00:00 2001 From: chflame163 Date: Sun, 11 Jan 2026 12:50:28 +0800 Subject: [PATCH] add debug info of ImageBatchToList and ImageListToBatch nodes --- py/data_nodes.py | 17 ++++++++++++++++- pyproject.toml | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/py/data_nodes.py b/py/data_nodes.py index 0e21121..036543d 100644 --- a/py/data_nodes.py +++ b/py/data_nodes.py @@ -464,6 +464,10 @@ class QueueStopNode(): class LS_ImageBatchToMultiList: + + def __init__(self): + self.NODE_NAME = 'ImageBatchToList' + @classmethod def INPUT_TYPES(s): return { @@ -491,15 +495,23 @@ class LS_ImageBatchToMultiList: """ B = image.shape[0] out = [] + sizes = [] for i in range(0, B, batch_size): batch = image[i:i + batch_size] out.append(batch) + sizes.append(batch.shape[0]) + + log(f"{self.NODE_NAME}: Convert a batch of {B} images to {sizes}.", message_type='finish') return (out,) class LS_MultiImageListToBatch: + + def __init__(self): + self.NODE_NAME = 'ImageListToBatch' + @classmethod def INPUT_TYPES(s): return { @@ -524,6 +536,7 @@ class LS_MultiImageListToBatch: # 以第一个 batch 的第一张图作为基准尺寸 base_h, base_w = image[0].shape[1:3] out = [] + sizes = [] for batch in image: # batch: [B, H, W, C] @@ -541,11 +554,13 @@ class LS_MultiImageListToBatch: # 转回 [B, H, W, C] batch = batch.permute(0, 2, 3, 1) - + print(f"batch.shape={batch.shape}") + sizes.append(batch.shape[0]) out.append(batch) # 沿 batch 维拼接 out = torch.cat(out, dim=0) + log(f"{self.NODE_NAME}: Convert {sizes} list(s) to a batch of {out.shape[0]} images.", message_type='finish') return (out,) diff --git a/pyproject.toml b/pyproject.toml index 24ec4f3..7b9c746 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_layerstyle" description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress." -version = "2.0.36" +version = "2.0.37" license = {text = "MIT License"} dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "scikit_learn", "opencv-contrib-python", "pymatting", "timm", "colour-science", "transformers", "blend_modes", "huggingface_hub", "loguru"]