From 13906ad1a21a58dcf8d6b8b8f22d41d891448606 Mon Sep 17 00:00:00 2001 From: Sirshendu Ganguly Date: Fri, 27 Mar 2026 16:09:04 -0400 Subject: [PATCH] Removed rounding off --- clientlibs/utils.js | 20 +++++++++++++++++--- modules/audioSettings.py | 6 +++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/clientlibs/utils.js b/clientlibs/utils.js index 7669e43..0e23548 100644 --- a/clientlibs/utils.js +++ b/clientlibs/utils.js @@ -8,6 +8,9 @@ const TIMEOUT_RANGE = { min: 5, default: 90, max: 99 }; const OUTPUT_QUALITY_RANGE = { min: 20, default: 95, max: 99 }; const CACHE_SIZE_RANGE = { min: 30, default: 150, max: 4096 }; +/** Must match `audioInferenceInputs.MAX_VIDEOS` in modules/audioInferenceInputs.py */ +const AUDIO_INFERENCE_INPUTS_MAX_VIDEOS = 4; + let openDialog = false; let lastTimeout = false; let lastOutputFormat = false; @@ -4171,12 +4174,23 @@ function audioInferenceInputsToggleHandler(audioInputsNode) { toggleWidgetState(useVideoWidget, videoWidget, "Video"); } - // Set up toggle handlers for multiple videos (Video1, Video2, Video3, Video4) + // Set up toggle handlers for multiple videos (Video1 … VideoN; N from widgets, fallback to AUDIO_INFERENCE_INPUTS_MAX_VIDEOS) if (useVideosWidget) { + function getAudioInferenceVideoSlotCount() { + let max = 0; + for (const w of audioInputsNode.widgets) { + if (!w?.name) continue; + const m = /^Video(\d+)$/.exec(w.name); + if (m) max = Math.max(max, parseInt(m[1], 10)); + } + return max > 0 ? max : AUDIO_INFERENCE_INPUTS_MAX_VIDEOS; + } + function toggleVideosEnabled() { const enabled = useVideosWidget.value === true; - - for (let i = 1; i <= 4; i++) { + const slotCount = getAudioInferenceVideoSlotCount(); + + for (let i = 1; i <= slotCount; i++) { const videoWidget = audioInputsNode.widgets.find(w => w && w.name === `Video${i}`); if (videoWidget) { if (videoWidget.inputEl) { diff --git a/modules/audioSettings.py b/modules/audioSettings.py index bfba7fe..e5a7151 100644 --- a/modules/audioSettings.py +++ b/modules/audioSettings.py @@ -222,13 +222,13 @@ class RunwareAudioSettings: settings["vocalLanguage"] = vocal_language if use_cover_conditioning_scale: - settings["coverConditioningScale"] = round(float(cover_conditioning_scale), 2) + settings["coverConditioningScale"] = float(cover_conditioning_scale) if use_repainting_start: - settings["repaintingStart"] = round(float(repainting_start), 2) + settings["repaintingStart"] = float(repainting_start) if use_repainting_end: - settings["repaintingEnd"] = round(float(repainting_end), 2) + settings["repaintingEnd"] = float(repainting_end) return (settings,)