diff --git a/__init__.py b/__init__.py index 5603cb8..fa80ec6 100644 --- a/__init__.py +++ b/__init__.py @@ -100,6 +100,7 @@ NODE_CLASS_MAPPINGS = { "FromDetailerPipe": FromDetailerPipe, "FromDetailerPipe_v2": FromDetailerPipe_v2, "FromDetailerPipeSDXL": FromDetailerPipe_SDXL, + "AnyPipeToBasic": AnyPipeToBasic, "ToBasicPipe": ToBasicPipe, "FromBasicPipe": FromBasicPipe, "FromBasicPipe_v2": FromBasicPipe_v2, @@ -234,6 +235,7 @@ NODE_CLASS_MAPPINGS = { "ImpactImageBatchToImageList": ImageBatchToImageList, "ImpactMakeImageList": MakeImageList, "ImpactMakeImageBatch": MakeImageBatch, + "ImpactMakeAnyList": MakeAnyList, "ImpactMakeMaskList": MakeMaskList, "ImpactMakeMaskBatch": MakeMaskBatch, diff --git a/js/impact-pack.js b/js/impact-pack.js index 9b506d6..c763ec2 100644 --- a/js/impact-pack.js +++ b/js/impact-pack.js @@ -394,7 +394,7 @@ app.registerExtension({ if (nodeData.name === 'ImpactMakeImageList' || nodeData.name === 'ImpactMakeImageBatch' || nodeData.name === 'ImpactMakeMaskList' || nodeData.name === 'ImpactMakeMaskBatch' || - nodeData.name === 'CombineRegionalPrompts' || + nodeData.name === 'ImpactMakeAnyList' || nodeData.name === 'CombineRegionalPrompts' || nodeData.name === 'ImpactCombineConditionings' || nodeData.name === 'ImpactConcatConditionings' || nodeData.name === 'ImpactSEGSConcat' || nodeData.name === 'ImpactSwitch' || nodeData.name === 'LatentSwitch' || nodeData.name == 'SEGSSwitch') { @@ -411,6 +411,10 @@ app.registerExtension({ input_name = "mask"; break; + case 'ImpactMakeAnyList': + input_name = "value"; + break; + case 'ImpactSEGSConcat': input_name = "segs"; break; diff --git a/modules/impact/pipe.py b/modules/impact/pipe.py index 2f6ca7e..c2b6457 100644 --- a/modules/impact/pipe.py +++ b/modules/impact/pipe.py @@ -1,5 +1,7 @@ import folder_paths import impact.wildcards +from impact.utils import any_typ + class ToDetailerPipe: @classmethod @@ -108,6 +110,23 @@ class FromDetailerPipe_SDXL: return detailer_pipe, model, clip, vae, positive, negative, bbox_detector, sam_model_opt, segm_detector_opt, detailer_hook, refiner_model, refiner_clip, refiner_positive, refiner_negative +class AnyPipeToBasic: + @classmethod + def INPUT_TYPES(s): + return { + "required": {"any_pipe": (any_typ,)}, + } + + RETURN_TYPES = ("BASIC_PIPE", ) + RETURN_NAMES = ("basic_pipe", ) + FUNCTION = "doit" + + CATEGORY = "ImpactPack/Pipe" + + def doit(self, any_pipe): + return (any_pipe[:5], ) + + class ToBasicPipe: @classmethod def INPUT_TYPES(s): diff --git a/modules/impact/util_nodes.py b/modules/impact/util_nodes.py index baee019..04d6b5f 100644 --- a/modules/impact/util_nodes.py +++ b/modules/impact/util_nodes.py @@ -392,6 +392,30 @@ class ImageBatchToImageList: return (images, ) +class MakeAnyList: + @classmethod + def INPUT_TYPES(s): + return { + "required": {}, + "optional": {"value1": (any_typ,), } + } + + RETURN_TYPES = (any_typ,) + OUTPUT_IS_LIST = (True,) + FUNCTION = "doit" + + CATEGORY = "ImpactPack/Util" + + def doit(self, **kwargs): + values = [] + + for k, v in kwargs.items(): + if v is not None: + values.append(v) + + return (values, ) + + class MakeMaskList: @classmethod def INPUT_TYPES(s):