From f2c2ffa586939e76e3b23dee3cbeba9d0cd1b394 Mon Sep 17 00:00:00 2001 From: ChrisColeTech Date: Mon, 24 Aug 2026 10:45:40 -0400 Subject: [PATCH] Make reset_bool a real toggle switch, not a NUMBER socket reset_bool was typed NUMBER, which has no native widget - it rendered as a bare (usually disconnected) socket, not something you could click. Changed to BOOLEAN with label_on="Reset"/label_off="Off" so it renders as an actual switch, matching ComfyUI-Get-Random-File's reset_bool convention. Simplified the reset check from `round(reset_bool) >= 1` (needed when the value could be an arbitrary wired number) to a plain `if reset_bool:` now that it's a real bool, and the function default to reset_bool=False to match. Note: any existing workflow with a NUMBER output wired into this socket will show as disconnected on next load - this input was always meant to be a toggle, not a numeric signal. Bump version from 1.0.9 to 1.0.10 --- line_counter.py | 8 +++++--- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/line_counter.py b/line_counter.py index d159260..c36844c 100644 --- a/line_counter.py +++ b/line_counter.py @@ -84,7 +84,9 @@ class SimpleNumberCounter: "step": ("FLOAT", {"default": 1, "min": 0, "max": 99999, "step": 0.01}), }, "optional": { - "reset_bool": ("NUMBER",), + "reset_bool": ("BOOLEAN", {"default": False, + "label_on": "Reset", + "label_off": "Off"}), }, "hidden": { "unique_id": "UNIQUE_ID", @@ -101,13 +103,13 @@ class SimpleNumberCounter: CATEGORY = "🤖 CCTech/Utilities" - def increment_number(self, number_type, mode, start, stop, step, unique_id, reset_bool=0): + def increment_number(self, number_type, mode, start, stop, step, unique_id, reset_bool=False): counter = int(start) if number_type == 'integer' else start if unique_id in self.counters: counter = self.counters[unique_id] - if round(reset_bool) >= 1: + if reset_bool: counter = start elif mode == 'increment': counter += step diff --git a/pyproject.toml b/pyproject.toml index d2671c8..9a5cf44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-line-counter" description = "This custom node package for ComfyUI is designed to streamline your workflow with powerful file-counting capabilities." -version = "1.0.9" +version = "1.0.10" license = {file = "LICENSE"} [project.urls]