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
3a1f9dba
Commit
3a1f9dba
authored
Apr 26, 2023
by
comfyanonymous
Browse files
If IS_CHANGED returns exception delete the output instead of crashing.
parent
951c0c2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
+26
-22
execution.py
execution.py
+26
-22
No files found.
execution.py
View file @
3a1f9dba
...
...
@@ -97,40 +97,44 @@ def recursive_output_delete_if_changed(prompt, old_prompt, outputs, current_item
is_changed_old
=
''
is_changed
=
''
to_delete
=
False
if
hasattr
(
class_def
,
'IS_CHANGED'
):
if
unique_id
in
old_prompt
and
'is_changed'
in
old_prompt
[
unique_id
]:
is_changed_old
=
old_prompt
[
unique_id
][
'is_changed'
]
if
'is_changed'
not
in
prompt
[
unique_id
]:
input_data_all
=
get_input_data
(
inputs
,
class_def
,
unique_id
,
outputs
)
if
input_data_all
is
not
None
:
is_changed
=
class_def
.
IS_CHANGED
(
**
input_data_all
)
prompt
[
unique_id
][
'is_changed'
]
=
is_changed
try
:
is_changed
=
class_def
.
IS_CHANGED
(
**
input_data_all
)
prompt
[
unique_id
][
'is_changed'
]
=
is_changed
except
:
to_delete
=
True
else
:
is_changed
=
prompt
[
unique_id
][
'is_changed'
]
if
unique_id
not
in
outputs
:
return
True
to_delete
=
False
if
is_changed
!=
is_changed_old
:
to_delete
=
True
elif
unique_id
not
in
old_prompt
:
to_delete
=
True
elif
inputs
==
old_prompt
[
unique_id
][
'inputs'
]:
for
x
in
inputs
:
input_data
=
inputs
[
x
]
if
isinstance
(
input_data
,
list
):
input_unique_id
=
input_data
[
0
]
output_index
=
input_data
[
1
]
if
input_unique_id
in
outputs
:
to_delete
=
recursive_output_delete_if_changed
(
prompt
,
old_prompt
,
outputs
,
input_unique_id
)
else
:
to_delete
=
True
if
to_delete
:
break
else
:
to_delete
=
True
if
not
to_delete
:
if
is_changed
!=
is_changed_old
:
to_delete
=
True
elif
unique_id
not
in
old_prompt
:
to_delete
=
True
elif
inputs
==
old_prompt
[
unique_id
][
'inputs'
]:
for
x
in
inputs
:
input_data
=
inputs
[
x
]
if
isinstance
(
input_data
,
list
):
input_unique_id
=
input_data
[
0
]
output_index
=
input_data
[
1
]
if
input_unique_id
in
outputs
:
to_delete
=
recursive_output_delete_if_changed
(
prompt
,
old_prompt
,
outputs
,
input_unique_id
)
else
:
to_delete
=
True
if
to_delete
:
break
else
:
to_delete
=
True
if
to_delete
:
d
=
outputs
.
pop
(
unique_id
)
...
...
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