From d759505fbe21c25bf190cbdc3c6b92f563a6b137 Mon Sep 17 00:00:00 2001 From: Nitin Garg <123405333+nitingrg@users.noreply.github.com> Date: Tue, 25 Nov 2025 10:11:54 -0500 Subject: [PATCH] Delete nodes.py --- nodes.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 nodes.py diff --git a/nodes.py b/nodes.py deleted file mode 100644 index 5e38543..0000000 --- a/nodes.py +++ /dev/null @@ -1,41 +0,0 @@ -import torch - -class ImageMegapixels: - @classmethod - def INPUT_TYPES(cls): - return { - "required": { - "image": ("IMAGE",), - } - } - - RETURN_TYPES = ("FLOAT",) - RETURN_NAMES = ("megapixels",) - FUNCTION = "calculate_megapixels" - CATEGORY = "utils" - - def calculate_megapixels(self, image): - # Safety checks - if image is None or image.dim() != 4: - return (0.0,) - - # Shape: [batch, height, width, channels] - _, height, width, _ = image.shape - - # Calculate megapixels (using first image in batch) - megapixels = (height * width) / 1_000_000.0 - - # Always return a float, never a string! - return (float(megapixels),) - - -# ──────────────────────────────── -# Node registration -# ──────────────────────────────── -NODE_CLASS_MAPPINGS = { - "ImageMegapixels": ImageMegapixels -} - -NODE_DISPLAY_NAME_MAPPINGS = { - "ImageMegapixels": "Calculate Image Megapixels" -} \ No newline at end of file