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
10bbf208
"examples/vscode:/vscode.git/clone" did not exist on "af8d3b97bae75591d18178b8c5fceac0d82ce85a"
Commit
10bbf208
authored
Mar 15, 2023
by
comfyanonymous
Browse files
Merge branch 'batch-count' of
https://github.com/m957ymj75urz/ComfyUI
parents
54593db6
29cee297
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
21 deletions
+50
-21
web/scripts/app.js
web/scripts/app.js
+21
-19
web/scripts/ui.js
web/scripts/ui.js
+29
-2
No files found.
web/scripts/app.js
View file @
10bbf208
...
...
@@ -662,7 +662,8 @@ class ComfyApp {
return
{
workflow
,
output
};
}
async
queuePrompt
(
number
)
{
async
queuePrompt
(
number
,
batchCount
=
1
)
{
for
(
let
i
=
0
;
i
<
batchCount
;
i
++
)
{
const
p
=
await
this
.
graphToPrompt
();
try
{
...
...
@@ -688,6 +689,7 @@ class ComfyApp {
this
.
canvas
.
draw
(
true
,
true
);
await
this
.
ui
.
queue
.
update
();
}
}
/**
* Loads workflow data from the specified file
...
...
web/scripts/ui.js
View file @
10bbf208
...
...
@@ -231,6 +231,7 @@ export class ComfyUI {
this
.
dialog
=
new
ComfyDialog
();
this
.
settings
=
new
ComfySettingsDialog
();
this
.
batchCount
=
1
;
this
.
queue
=
new
ComfyList
(
"
Queue
"
);
this
.
history
=
new
ComfyList
(
"
History
"
);
...
...
@@ -254,9 +255,35 @@ export class ComfyUI {
$el
(
"
span
"
,
{
$
:
(
q
)
=>
(
this
.
queueSize
=
q
)
}),
$el
(
"
button.comfy-settings-btn
"
,
{
textContent
:
"
⚙️
"
,
onclick
:
()
=>
this
.
settings
.
show
()
}),
]),
$el
(
"
button.comfy-queue-btn
"
,
{
textContent
:
"
Queue Prompt
"
,
onclick
:
()
=>
app
.
queuePrompt
(
0
)
}),
$el
(
"
button.comfy-queue-btn
"
,
{
textContent
:
"
Queue Prompt
"
,
onclick
:
()
=>
app
.
queuePrompt
(
0
,
this
.
batchCount
)
}),
$el
(
"
div
"
,
{},
[
$el
(
"
label
"
,
{
innerHTML
:
"
Extra options
"
},
[
$el
(
"
input
"
,
{
type
:
"
checkbox
"
,
onchange
:
(
i
)
=>
{
document
.
getElementById
(
'
extraOptions
'
).
style
.
visibility
=
i
.
srcElement
.
checked
?
"
visible
"
:
"
collapse
"
;
this
.
batchCount
=
i
.
srcElement
.
checked
?
document
.
getElementById
(
'
batchCountInputRange
'
).
value
:
1
;
}
})
])
]),
$el
(
"
div
"
,
{
id
:
"
extraOptions
"
,
style
:
{
width
:
"
100%
"
,
visibility
:
"
collapse
"
}},
[
$el
(
"
label
"
,
{
innerHTML
:
"
Batch count
"
},
[
$el
(
"
input
"
,
{
id
:
"
batchCountInputNumber
"
,
type
:
"
number
"
,
value
:
this
.
batchCount
,
min
:
"
1
"
,
style
:
{
width
:
"
35%
"
,
"
margin-left
"
:
"
0.4em
"
},
oninput
:
(
i
)
=>
{
this
.
batchCount
=
i
.
target
.
value
;
document
.
getElementById
(
'
batchCountInputRange
'
).
value
=
this
.
batchCount
;
}
}),
$el
(
"
input
"
,
{
id
:
"
batchCountInputRange
"
,
type
:
"
range
"
,
min
:
"
1
"
,
max
:
"
100
"
,
value
:
this
.
batchCount
,
oninput
:
(
i
)
=>
{
this
.
batchCount
=
i
.
srcElement
.
value
;
document
.
getElementById
(
'
batchCountInputNumber
'
).
value
=
i
.
srcElement
.
value
;
}
}),
]),
]),
$el
(
"
div.comfy-menu-btns
"
,
[
$el
(
"
button
"
,
{
textContent
:
"
Queue Front
"
,
onclick
:
()
=>
app
.
queuePrompt
(
-
1
)
}),
$el
(
"
button
"
,
{
textContent
:
"
Queue Front
"
,
onclick
:
()
=>
app
.
queuePrompt
(
-
1
,
this
.
batchCount
)
}),
$el
(
"
button
"
,
{
$
:
(
b
)
=>
(
this
.
queue
.
button
=
b
),
textContent
:
"
View Queue
"
,
...
...
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