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
This commit is contained in:
+5
-3
@@ -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
|
||||
|
||||
+1
-1
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user