mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-09 13:02:31 +08:00
Merge branch 'comfyanonymous:master' into feature/maskpainting
This commit is contained in:
commit
d40e08cb5f
@ -4,7 +4,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from typing import Literal
|
try:
|
||||||
|
from typing import Literal
|
||||||
|
except ImportError:
|
||||||
|
from typing_extensions import Literal
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
|
|||||||
@ -9953,11 +9953,11 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "slider":
|
case "slider":
|
||||||
var range = w.options.max - w.options.min;
|
var old_value = w.value;
|
||||||
var nvalue = Math.clamp((x - 15) / (widget_width - 30), 0, 1);
|
var nvalue = Math.clamp((x - 15) / (widget_width - 30), 0, 1);
|
||||||
if(w.options.read_only) break;
|
if(w.options.read_only) break;
|
||||||
w.value = w.options.min + (w.options.max - w.options.min) * nvalue;
|
w.value = w.options.min + (w.options.max - w.options.min) * nvalue;
|
||||||
if (w.callback) {
|
if (old_value != w.value) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
inner_value_change(w, w.value);
|
inner_value_change(w, w.value);
|
||||||
}, 20);
|
}, 20);
|
||||||
@ -10044,7 +10044,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
if (event.click_time < 200 && delta == 0) {
|
if (event.click_time < 200 && delta == 0) {
|
||||||
this.prompt("Value",w.value,function(v) {
|
this.prompt("Value",w.value,function(v) {
|
||||||
// check if v is a valid equation or a number
|
// check if v is a valid equation or a number
|
||||||
if (/^[0-9+\-*/()\s]+$/.test(v)) {
|
if (/^[0-9+\-*/()\s]+|\d+\.\d+$/.test(v)) {
|
||||||
try {//solve the equation if possible
|
try {//solve the equation if possible
|
||||||
v = eval(v);
|
v = eval(v);
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user