From 0e036b34d9578d87ae701b62353a97ad3c0f789d Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Wed, 17 Jun 2026 12:22:19 +0200 Subject: [PATCH] fix(ui): string-valued input_sr combo so the arrows cycle correctly Integer-valued combos break ComfyUI's arrow navigation: indexOf(value) fails on the int/serialized-value mismatch, returns -1, and the widget snaps to index 0 (8000) every click. Use string options ("8000".."24000"); the code already does int(input_sr) everywhere, so behavior is unchanged. Updated the example workflows' widgets_values to strings to match. Co-Authored-By: Claude Opus 4.8 --- example_workflows/universr_super_resolution.json | 2 +- example_workflows/universr_video.json | 2 +- nodes.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example_workflows/universr_super_resolution.json b/example_workflows/universr_super_resolution.json index b23411f..6f72520 100644 --- a/example_workflows/universr_super_resolution.json +++ b/example_workflows/universr_super_resolution.json @@ -49,7 +49,7 @@ {"name": "spectrogram", "type": "IMAGE", "links": [4], "slot_index": 1} ], "properties": {"Node name for S&R": "UniverSRSampler"}, - "widgets_values": [8000, "midpoint", 4, 1.5, 0, "randomize", 10.0, 0.5, 1.0, false, true] + "widgets_values": ["8000", "midpoint", 4, 1.5, 0, "randomize", 10.0, 0.5, 1.0, false, true] }, { "id": 4, diff --git a/example_workflows/universr_video.json b/example_workflows/universr_video.json index 426f8e5..fdaa91c 100644 --- a/example_workflows/universr_video.json +++ b/example_workflows/universr_video.json @@ -50,7 +50,7 @@ {"name": "spectrogram", "type": "IMAGE", "links": [], "slot_index": 1} ], "properties": {"Node name for S&R": "UniverSRSampler"}, - "widgets_values": [16000, "midpoint", 4, 2.0, 0, "randomize", 10.0, 0.5, 1.0, false, true] + "widgets_values": ["16000", "midpoint", 4, 2.0, 0, "randomize", 10.0, 0.5, 1.0, false, true] }, { "id": 4, diff --git a/nodes.py b/nodes.py index 1e8e79a..45849aa 100644 --- a/nodes.py +++ b/nodes.py @@ -118,8 +118,8 @@ class UniverSRSampler: "required": { "audio": ("AUDIO", {}), "model": ("UNIVERSR_MODEL", {}), - "input_sr": ([8000, 12000, 16000, 24000], { - "default": 8000, + "input_sr": (["8000", "12000", "16000", "24000"], { + "default": "8000", "tooltip": "Effective input bandwidth (Hz). Content is treated as valid up to " "input_sr/2 and regenerated above it. 8000 = genuine low-rate audio " "(strongest, 8 kHz->48 kHz). 16000 = brighten muffled audio above 8 kHz.",