From 40b6e612981bd2cdbfb7f049ca45284e25909a04 Mon Sep 17 00:00:00 2001 From: ChrisColeTech Date: Mon, 24 Aug 2026 10:21:20 -0400 Subject: [PATCH] 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 --- line_counter.py | 9 ++++----- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/line_counter.py b/line_counter.py index df336c8..d159260 100644 --- a/line_counter.py +++ b/line_counter.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 49dbfc1..d2671c8 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.8" +version = "1.0.9" license = {file = "LICENSE"} [project.urls]