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
dc85b3b8
Commit
dc85b3b8
authored
Mar 03, 2023
by
pythongosssss
Browse files
Allow serializeValue to be async
parent
99131140
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
web/scripts/app.js
web/scripts/app.js
+3
-3
No files found.
web/scripts/app.js
View file @
dc85b3b8
...
@@ -585,7 +585,7 @@ class ComfyApp {
...
@@ -585,7 +585,7 @@ class ComfyApp {
* Converts the current graph workflow for sending to the API
* Converts the current graph workflow for sending to the API
* @returns The workflow and node links
* @returns The workflow and node links
*/
*/
graphToPrompt
()
{
async
graphToPrompt
()
{
const
workflow
=
this
.
graph
.
serialize
();
const
workflow
=
this
.
graph
.
serialize
();
const
output
=
{};
const
output
=
{};
for
(
const
n
of
workflow
.
nodes
)
{
for
(
const
n
of
workflow
.
nodes
)
{
...
@@ -604,7 +604,7 @@ class ComfyApp {
...
@@ -604,7 +604,7 @@ class ComfyApp {
for
(
const
i
in
widgets
)
{
for
(
const
i
in
widgets
)
{
const
widget
=
widgets
[
i
];
const
widget
=
widgets
[
i
];
if
(
!
widget
.
options
||
widget
.
options
.
serialize
!==
false
)
{
if
(
!
widget
.
options
||
widget
.
options
.
serialize
!==
false
)
{
inputs
[
widget
.
name
]
=
widget
.
serializeValue
?
widget
.
serializeValue
(
n
,
i
)
:
widget
.
value
;
inputs
[
widget
.
name
]
=
widget
.
serializeValue
?
await
widget
.
serializeValue
(
n
,
i
)
:
widget
.
value
;
}
}
}
}
}
}
...
@@ -649,7 +649,7 @@ class ComfyApp {
...
@@ -649,7 +649,7 @@ class ComfyApp {
}
}
async
queuePrompt
(
number
)
{
async
queuePrompt
(
number
)
{
const
p
=
this
.
graphToPrompt
();
const
p
=
await
this
.
graphToPrompt
();
try
{
try
{
await
api
.
queuePrompt
(
number
,
p
);
await
api
.
queuePrompt
(
number
,
p
);
...
...
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