mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-25 18:02:37 +08:00
Merge branch 'master' into fix/glsl-blur-texel-size
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
This commit is contained in:
commit
75d62f9e06
@ -1,5 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
from comfy.comfy_types.node_typing import IO
|
from comfy.comfy_types.node_typing import IO
|
||||||
|
import torch
|
||||||
|
|
||||||
# Preview Any - original implement from
|
# Preview Any - original implement from
|
||||||
# https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
|
# https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
|
||||||
@ -19,6 +20,7 @@ class PreviewAny():
|
|||||||
SEARCH_ALIASES = ["show output", "inspect", "debug", "print value", "show text"]
|
SEARCH_ALIASES = ["show output", "inspect", "debug", "print value", "show text"]
|
||||||
|
|
||||||
def main(self, source=None):
|
def main(self, source=None):
|
||||||
|
torch.set_printoptions(edgeitems=6)
|
||||||
value = 'None'
|
value = 'None'
|
||||||
if isinstance(source, str):
|
if isinstance(source, str):
|
||||||
value = source
|
value = source
|
||||||
@ -33,6 +35,7 @@ class PreviewAny():
|
|||||||
except Exception:
|
except Exception:
|
||||||
value = 'source exists, but could not be serialized.'
|
value = 'source exists, but could not be serialized.'
|
||||||
|
|
||||||
|
torch.set_printoptions()
|
||||||
return {"ui": {"text": (value,)}, "result": (value,)}
|
return {"ui": {"text": (value,)}, "result": (value,)}
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
|||||||
38
execution.py
38
execution.py
@ -811,11 +811,30 @@ class PromptExecutor:
|
|||||||
self._notify_prompt_lifecycle("end", prompt_id)
|
self._notify_prompt_lifecycle("end", prompt_id)
|
||||||
|
|
||||||
|
|
||||||
async def validate_inputs(prompt_id, prompt, item, validated):
|
async def validate_inputs(prompt_id, prompt, item, validated, visiting=None):
|
||||||
|
if visiting is None:
|
||||||
|
visiting = []
|
||||||
|
|
||||||
unique_id = item
|
unique_id = item
|
||||||
if unique_id in validated:
|
if unique_id in validated:
|
||||||
return validated[unique_id]
|
return validated[unique_id]
|
||||||
|
|
||||||
|
if unique_id in visiting:
|
||||||
|
cycle_path_nodes = visiting[visiting.index(unique_id):] + [unique_id]
|
||||||
|
cycle_nodes = list(dict.fromkeys(cycle_path_nodes))
|
||||||
|
cycle_path = " -> ".join(f"{node_id} ({prompt[node_id]['class_type']})" for node_id in cycle_path_nodes)
|
||||||
|
for node_id in cycle_nodes:
|
||||||
|
validated[node_id] = (False, [{
|
||||||
|
"type": "dependency_cycle",
|
||||||
|
"message": "Dependency cycle detected",
|
||||||
|
"details": cycle_path,
|
||||||
|
"extra_info": {
|
||||||
|
"node_id": node_id,
|
||||||
|
"cycle_nodes": cycle_nodes,
|
||||||
|
}
|
||||||
|
}], node_id)
|
||||||
|
return validated[unique_id]
|
||||||
|
|
||||||
inputs = prompt[unique_id]['inputs']
|
inputs = prompt[unique_id]['inputs']
|
||||||
class_type = prompt[unique_id]['class_type']
|
class_type = prompt[unique_id]['class_type']
|
||||||
obj_class = nodes.NODE_CLASS_MAPPINGS[class_type]
|
obj_class = nodes.NODE_CLASS_MAPPINGS[class_type]
|
||||||
@ -899,7 +918,11 @@ async def validate_inputs(prompt_id, prompt, item, validated):
|
|||||||
errors.append(error)
|
errors.append(error)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
r = await validate_inputs(prompt_id, prompt, o_id, validated)
|
visiting.append(unique_id)
|
||||||
|
try:
|
||||||
|
r = await validate_inputs(prompt_id, prompt, o_id, validated, visiting)
|
||||||
|
finally:
|
||||||
|
visiting.pop()
|
||||||
if r[0] is False:
|
if r[0] is False:
|
||||||
# `r` will be set in `validated[o_id]` already
|
# `r` will be set in `validated[o_id]` already
|
||||||
valid = False
|
valid = False
|
||||||
@ -1048,10 +1071,13 @@ async def validate_inputs(prompt_id, prompt, item, validated):
|
|||||||
errors.append(error)
|
errors.append(error)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if len(errors) > 0 or valid is not True:
|
ret = validated.get(unique_id, (True, [], unique_id))
|
||||||
ret = (False, errors, unique_id)
|
# Recursive cycle detection may have already populated an error on us. Join it.
|
||||||
else:
|
ret = (
|
||||||
ret = (True, [], unique_id)
|
ret[0] and valid is True and not errors,
|
||||||
|
ret[1] + [error for error in errors if error not in ret[1]],
|
||||||
|
unique_id,
|
||||||
|
)
|
||||||
|
|
||||||
validated[unique_id] = ret
|
validated[unique_id] = ret
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
comfyui-frontend-package==1.42.14
|
comfyui-frontend-package==1.42.14
|
||||||
comfyui-workflow-templates==0.9.61
|
comfyui-workflow-templates==0.9.62
|
||||||
comfyui-embedded-docs==0.4.4
|
comfyui-embedded-docs==0.4.4
|
||||||
torch
|
torch
|
||||||
torchsde
|
torchsde
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user