From d2b375fff626f18760146a68ed019acf3571d21e Mon Sep 17 00:00:00 2001 From: nkchocoai Date: Fri, 16 Feb 2024 23:06:20 +0900 Subject: [PATCH] Add batch_size meta data --- README.md | 3 +++ py/nodes/node.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8b5b63 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +## TODO +- batch_size >= 2の場合、Seedが変わるだけか調査 +- EmptyLatentImageFromPresetsへの対応 \ No newline at end of file diff --git a/py/nodes/node.py b/py/nodes/node.py index 4b75073..27b452d 100644 --- a/py/nodes/node.py +++ b/py/nodes/node.py @@ -50,7 +50,7 @@ class SaveImageWithMetaData(BaseNode): ) results = list() print("Save Image With Metadata") - for image in images: + for index, image in enumerate(images): i = 255.0 * image.cpu().numpy() img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)) @@ -58,6 +58,9 @@ class SaveImageWithMetaData(BaseNode): print("[get_inputs]") print(inputs) pnginfo_dict = Capture.gen_pnginfo_dict(inputs) + if len(images) >= 2: + pnginfo_dict["Batch index"] = index + pnginfo_dict["Batch size"] = len(images) print("[PNGInfo Dict]") print(pnginfo_dict)