diff --git a/__init__.py b/__init__.py index 37af647..1650b01 100644 --- a/__init__.py +++ b/__init__.py @@ -288,6 +288,7 @@ NODE_CLASS_MAPPINGS = { "ImpactValueSender": ImpactValueSender, "ImpactValueReceiver": ImpactValueReceiver, "ImpactImageInfo": ImpactImageInfo, + "ImpactLatentInfo": ImpactLatentInfo, "ImpactMinMax": ImpactMinMax, "ImpactNeg": ImpactNeg, "ImpactConditionalStopIteration": ImpactConditionalStopIteration, diff --git a/modules/impact/logics.py b/modules/impact/logics.py index e0f5115..8aa156d 100644 --- a/modules/impact/logics.py +++ b/modules/impact/logics.py @@ -248,6 +248,26 @@ class ImpactImageInfo: return (value.shape[0], value.shape[1], value.shape[2], value.shape[3]) +class ImpactLatentInfo: + @classmethod + def INPUT_TYPES(cls): + return {"required": { + "value": ("LATENT", ), + }, + } + + FUNCTION = "doit" + + CATEGORY = "ImpactPack/Logic/_for_test" + + RETURN_TYPES = ("INT", "INT", "INT", "INT") + RETURN_NAMES = ("batch", "height", "width", "channel") + + def doit(self, value): + shape = value['samples'].shape + return (shape[0], shape[2] * 8, shape[3] * 8, shape[1]) + + class ImpactMinMax: @classmethod def INPUT_TYPES(cls):