feat(loras): warn when widget strength leaves the usage-tips range

The cycler-list payload now carries usage_tips, and the LORAS widget
parses strength_min/strength_max/strength_range into a cached lookup.
Strength inputs (model and clip) turn amber with an explanatory tooltip
when dragged, typed, or stepped outside the recommended range.

Related: https://github.com/willmiao/ComfyUI-Lora-Manager/issues/1090
This commit is contained in:
Will Miao
2026-09-19 05:49:01 +08:00
parent 3b9e8efb3d
commit c8c84bfc54
7 changed files with 584 additions and 8 deletions
+4
View File
@@ -7,6 +7,8 @@ import {
syncClipStrengthIfCollapsed,
getAvailableLoras,
getAvailableLorasSync,
getLoraStrengthRange,
applyStrengthRangeCue,
isLoraNameAvailable,
onLibraryChanged
} from "./loras_widget_utils.js";
@@ -521,6 +523,7 @@ export function addLorasWidget(node, name, opts, callback) {
strengthEl.classList.add("lm-lora-strength-input");
strengthEl.type = "text";
strengthEl.value = typeof strength === 'number' ? strength.toFixed(2) : Number(strength).toFixed(2);
applyStrengthRangeCue(strengthEl, strength, getLoraStrengthRange(name));
strengthEl.addEventListener('pointerdown', () => {
pendingFocusTarget = { name, type: "strength" };
});
@@ -650,6 +653,7 @@ export function addLorasWidget(node, name, opts, callback) {
clipStrengthEl.classList.add("lm-lora-strength-input", "lm-lora-clip-strength-input");
clipStrengthEl.type = "text";
clipStrengthEl.value = typeof clipStrength === 'number' ? clipStrength.toFixed(2) : Number(clipStrength).toFixed(2);
applyStrengthRangeCue(clipStrengthEl, clipStrength, getLoraStrengthRange(name));
clipStrengthEl.addEventListener('pointerdown', () => {
pendingFocusTarget = { name, type: "clip" };
});