Fix Simple Number Counter reset not returning to start, and dead decrement mode
reset_bool set counter back to `start`, but execution fell through into the increment/decrement branch immediately after regardless, so the returned value on a reset call was always start + step, never start itself - reset appeared to do nothing. Made reset an elif so it short- circuits the step logic for that call. Also: `elif mode == 'deccrement':` (typo, extra c) never matched the real mode value "decrement", so decrement mode silently did nothing - fixed to match. And number_type-vs-mode was swapped in the initial counter cast (`int(start) if mode == 'integer' else start` - mode is never "integer", that's number_type), so a fresh integer counter's very first value was never actually cast to int. Bump version from 1.0.8 to 1.0.9
This commit is contained in:
+4
-5
@@ -103,16 +103,15 @@ class SimpleNumberCounter:
|
||||
|
||||
def increment_number(self, number_type, mode, start, stop, step, unique_id, reset_bool=0):
|
||||
|
||||
counter = int(start) if mode == 'integer' else start
|
||||
if self.counters.__contains__(unique_id):
|
||||
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:
|
||||
counter = start
|
||||
|
||||
if mode == 'increment':
|
||||
elif mode == 'increment':
|
||||
counter += step
|
||||
elif mode == 'deccrement':
|
||||
elif mode == 'decrement':
|
||||
counter -= step
|
||||
elif mode == 'increment_to_stop':
|
||||
counter = counter + step if counter < stop else counter
|
||||
|
||||
+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.8"
|
||||
version = "1.0.9"
|
||||
license = {file = "LICENSE"}
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user