Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
e4a3e9e5
"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "b0a07e5265d36a0863591e3117b1cebf294dfd04"
Commit
e4a3e9e5
authored
Aug 01, 2023
by
comfyanonymous
Browse files
Add an option in the UI to disable sliders.
parent
834ab278
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
web/scripts/ui.js
web/scripts/ui.js
+7
-0
web/scripts/widgets.js
web/scripts/widgets.js
+12
-7
No files found.
web/scripts/ui.js
View file @
e4a3e9e5
...
@@ -542,6 +542,13 @@ export class ComfyUI {
...
@@ -542,6 +542,13 @@ export class ComfyUI {
defaultValue
:
""
,
defaultValue
:
""
,
});
});
this
.
settings
.
addSetting
({
id
:
"
Comfy.DisableSliders
"
,
name
:
"
Disable sliders.
"
,
type
:
"
boolean
"
,
defaultValue
:
false
,
});
const
fileInput
=
$el
(
"
input
"
,
{
const
fileInput
=
$el
(
"
input
"
,
{
id
:
"
comfy-file-input
"
,
id
:
"
comfy-file-input
"
,
type
:
"
file
"
,
type
:
"
file
"
,
...
...
web/scripts/widgets.js
View file @
e4a3e9e5
...
@@ -79,8 +79,8 @@ export function addValueControlWidget(node, targetWidget, defaultValue = "random
...
@@ -79,8 +79,8 @@ export function addValueControlWidget(node, targetWidget, defaultValue = "random
return
valueControl
;
return
valueControl
;
};
};
function
seedWidget
(
node
,
inputName
,
inputData
)
{
function
seedWidget
(
node
,
inputName
,
inputData
,
app
)
{
const
seed
=
ComfyWidgets
.
INT
(
node
,
inputName
,
inputData
);
const
seed
=
ComfyWidgets
.
INT
(
node
,
inputName
,
inputData
,
app
);
const
seedControl
=
addValueControlWidget
(
node
,
seed
.
widget
,
"
randomize
"
);
const
seedControl
=
addValueControlWidget
(
node
,
seed
.
widget
,
"
randomize
"
);
seed
.
widget
.
linkedWidgets
=
[
seedControl
];
seed
.
widget
.
linkedWidgets
=
[
seedControl
];
...
@@ -250,20 +250,25 @@ function addMultilineWidget(node, name, opts, app) {
...
@@ -250,20 +250,25 @@ function addMultilineWidget(node, name, opts, app) {
return
{
minWidth
:
400
,
minHeight
:
200
,
widget
};
return
{
minWidth
:
400
,
minHeight
:
200
,
widget
};
}
}
function
isSlider
(
display
)
{
function
isSlider
(
display
,
app
)
{
if
(
app
.
ui
.
settings
.
getSettingValue
(
"
Comfy.DisableSliders
"
))
{
return
"
number
"
}
return
(
display
===
"
slider
"
)
?
"
slider
"
:
"
number
"
return
(
display
===
"
slider
"
)
?
"
slider
"
:
"
number
"
}
}
export
const
ComfyWidgets
=
{
export
const
ComfyWidgets
=
{
"
INT:seed
"
:
seedWidget
,
"
INT:seed
"
:
seedWidget
,
"
INT:noise_seed
"
:
seedWidget
,
"
INT:noise_seed
"
:
seedWidget
,
FLOAT
(
node
,
inputName
,
inputData
)
{
FLOAT
(
node
,
inputName
,
inputData
,
app
)
{
let
widgetType
=
isSlider
(
inputData
[
1
][
"
display
"
]);
let
widgetType
=
isSlider
(
inputData
[
1
][
"
display
"
]
,
app
);
const
{
val
,
config
}
=
getNumberDefaults
(
inputData
,
0.5
);
const
{
val
,
config
}
=
getNumberDefaults
(
inputData
,
0.5
);
return
{
widget
:
node
.
addWidget
(
widgetType
,
inputName
,
val
,
()
=>
{},
config
)
};
return
{
widget
:
node
.
addWidget
(
widgetType
,
inputName
,
val
,
()
=>
{},
config
)
};
},
},
INT
(
node
,
inputName
,
inputData
)
{
INT
(
node
,
inputName
,
inputData
,
app
)
{
let
widgetType
=
isSlider
(
inputData
[
1
][
"
display
"
]);
console
.
log
(
app
);
let
widgetType
=
isSlider
(
inputData
[
1
][
"
display
"
],
app
);
const
{
val
,
config
}
=
getNumberDefaults
(
inputData
,
1
);
const
{
val
,
config
}
=
getNumberDefaults
(
inputData
,
1
);
Object
.
assign
(
config
,
{
precision
:
0
});
Object
.
assign
(
config
,
{
precision
:
0
});
return
{
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment