diff --git a/README.md b/README.md index 17080a2..e18616a 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ This takes latent as input and outputs latent as the result. * Image batch To Image List - Convert Image batch to Image List - You can use images generated in a multi batch to handle them * Make Image List - Convert multiple images into a single image list +* Make Image Batch - Convert multiple images into a single image batch - The input of images can be scaled up as needed * String Selector - It selects and returns a portion of the string. When `multiline` mode is disabled, it simply returns the string of the line pointed to by the selector. When `multiline` mode is enabled, it divides the string based on lines that start with `#` and returns them. If the `select` value is larger than the number of items, it will start counting from the first line again and return accordingly. diff --git a/__init__.py b/__init__.py index 045b6ad..8b38880 100644 --- a/__init__.py +++ b/__init__.py @@ -223,6 +223,7 @@ NODE_CLASS_MAPPINGS = { "ImpactImageBatchToImageList": ImageBatchToImageList, "ImpactMakeImageList": MakeImageList, + "ImpactMakeImageBatch": MakeImageBatch, "RegionalSampler": RegionalSampler, "RegionalSamplerAdvanced": RegionalSamplerAdvanced, @@ -327,6 +328,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { "MaskListToMaskBatch": "Mask List to Masks", "ImpactImageBatchToImageList": "Image batch to Image List", "ImpactMakeImageList": "Make Image List", + "ImpactMakeImageBatch": "Make Image Batch", "ImpactStringSelector": "String Selector", "RemoveNoiseMask": "Remove Noise Mask", diff --git a/js/impact-pack.js b/js/impact-pack.js index 54adeee..86c1ff8 100644 --- a/js/impact-pack.js +++ b/js/impact-pack.js @@ -285,11 +285,14 @@ app.registerExtension({ } } - if (nodeData.name === 'ImpactMakeImageList' || nodeData.name === 'CombineRegionalPrompts' || nodeData.name === 'ImpactSwitch' || nodeData.name === 'LatentSwitch' || nodeData.name == 'SEGSSwitch') { + if (nodeData.name === 'ImpactMakeImageList' || nodeData.name === 'ImpactMakeImageBatch' || + nodeData.name === 'CombineRegionalPrompts' || nodeData.name === 'ImpactSwitch' || + nodeData.name === 'LatentSwitch' || nodeData.name == 'SEGSSwitch') { var input_name = "input"; switch(nodeData.name) { case 'ImpactMakeImageList': + case 'ImpactMakeImageBatch': input_name = "image"; break; diff --git a/modules/impact/config.py b/modules/impact/config.py index 05321b2..a02b376 100644 --- a/modules/impact/config.py +++ b/modules/impact/config.py @@ -2,7 +2,7 @@ import configparser import os -version = "V4.9.6" +version = "V4.10" dependency_version = 12 diff --git a/modules/impact/impact_pack.py b/modules/impact/impact_pack.py index fcb801a..bddc5bc 100644 --- a/modules/impact/impact_pack.py +++ b/modules/impact/impact_pack.py @@ -1982,6 +1982,31 @@ class MakeImageList: return (images, ) +class MakeImageBatch: + @classmethod + def INPUT_TYPES(s): + return {"required": {"image1": ("IMAGE",), }} + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "doit" + + CATEGORY = "ImpactPack/Util" + + def doit(self, **kwargs): + image1 = kwargs['image1'] + del kwargs['image1'] + images = [value for value in kwargs.values()] + + if len(images) == 0: + return (image1,) + else: + for image2 in images: + if image1.shape[1:] != image2.shape[1:]: + image2 = comfy.utils.common_upscale(image2.movedim(-1, 1), image1.shape[2], image1.shape[1], "bilinear", "center").movedim(1, -1) + image1 = torch.cat((image1, image2), dim=0) + return (image1,) + + class StringSelector: @classmethod def INPUT_TYPES(s):