mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-21 03:01:27 -03:00
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:
@@ -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" };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user