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
58695f9c
Commit
58695f9c
authored
Mar 25, 2023
by
comfyanonymous
Browse files
Fix seed being impossible to increment/decrement by 1.
parent
a30526ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
web/scripts/widgets.js
web/scripts/widgets.js
+5
-1
No files found.
web/scripts/widgets.js
View file @
58695f9c
...
@@ -20,8 +20,12 @@ export function addRandomizeWidget(node, targetWidget, name, defaultValue = fals
...
@@ -20,8 +20,12 @@ export function addRandomizeWidget(node, targetWidget, name, defaultValue = fals
randomize
.
afterQueued
=
()
=>
{
randomize
.
afterQueued
=
()
=>
{
if
(
randomize
.
value
)
{
if
(
randomize
.
value
)
{
const
min
=
targetWidget
.
options
?.
min
;
const
min
=
targetWidget
.
options
?.
min
;
cons
t
max
=
targetWidget
.
options
?.
max
;
le
t
max
=
targetWidget
.
options
?.
max
;
if
(
min
!=
null
||
max
!=
null
)
{
if
(
min
!=
null
||
max
!=
null
)
{
if
(
max
)
{
// limit max to something that javascript can handle
max
=
Math
.
min
(
1125899906842624
,
max
);
}
targetWidget
.
value
=
Math
.
floor
(
Math
.
random
()
*
((
max
??
9999999999
)
-
(
min
??
0
)
+
1
)
+
(
min
??
0
));
targetWidget
.
value
=
Math
.
floor
(
Math
.
random
()
*
((
max
??
9999999999
)
-
(
min
??
0
)
+
1
)
+
(
min
??
0
));
}
else
{
}
else
{
targetWidget
.
value
=
Math
.
floor
(
Math
.
random
()
*
1125899906842624
);
targetWidget
.
value
=
Math
.
floor
(
Math
.
random
()
*
1125899906842624
);
...
...
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