mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 12:50:18 +08:00
Add docs on when ExecutionBlocker should be used
This commit is contained in:
parent
dd3bafb40b
commit
7dbee88485
@ -208,6 +208,16 @@ class ExecutionList(TopologicalSort):
|
|||||||
return list(blocked_by.keys())
|
return list(blocked_by.keys())
|
||||||
|
|
||||||
# Return this from a node and any users will be blocked with the given error message.
|
# Return this from a node and any users will be blocked with the given error message.
|
||||||
|
# If the message is None, execution will be blocked silently instead.
|
||||||
|
# Generally, you should avoid using this functionality unless absolutley necessary. Whenever it's
|
||||||
|
# possible, a lazy input will be more efficient and have a better user experience.
|
||||||
|
# This functionality is useful in two cases:
|
||||||
|
# 1. You want to conditionally prevent an output node from executing. (Particularly a built-in node
|
||||||
|
# like SaveImage. For your own output nodes, I would recommend just adding a BOOL input and using
|
||||||
|
# lazy evaluation to let it conditionally disable itself.)
|
||||||
|
# 2. You have a node with multiple possible outputs, some of which are invalid and should not be used.
|
||||||
|
# (I would recommend not making nodes like this in the future -- instead, make multiple nodes with
|
||||||
|
# different outputs. Unfortunately, there are several popular existing nodes using this pattern.)
|
||||||
class ExecutionBlocker:
|
class ExecutionBlocker:
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
self.message = message
|
self.message = message
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user