Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution Model Inversion #2666

Merged
merged 39 commits into from
Aug 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
36b2214
Execution Model Inversion
guill Jan 29, 2024
e4e20d7
Allow `input_info` to be of type `None`
guill Feb 15, 2024
2c7145d
Handle errors (like OOM) more gracefully
guill Feb 15, 2024
12627ca
Add a command-line argument to enable variants
guill Feb 15, 2024
9c1e3f7
Fix an overly aggressive assertion.
guill Feb 18, 2024
508d286
Fix Pyright warnings
guill Feb 18, 2024
fff2283
Add execution model unit tests
guill Feb 18, 2024
e60dbe3
Fix issue with unused literals
guill Feb 22, 2024
5ab1565
Merge branch 'master' into execution_model_inversion
guill Feb 22, 2024
6d09dd7
Make custom VALIDATE_INPUTS skip normal validation
guill Feb 25, 2024
6b6a93c
Merge branch 'master' into execution_model_inversion
guill Mar 23, 2024
03394ac
Fix example in unit test
guill Mar 23, 2024
a0bf532
Use fstrings instead of '%' formatting syntax
guill Apr 21, 2024
5dc1365
Use custom exception types.
guill Apr 21, 2024
dd3bafb
Display an error for dependency cycles
guill Apr 21, 2024
7dbee88
Add docs on when ExecutionBlocker should be used
guill Apr 21, 2024
b5e4583
Remove unused functionality
guill Apr 21, 2024
75774c6
Rename ExecutionResult.SLEEPING to PENDING
guill Apr 21, 2024
ecbef30
Remove superfluous function parameter
guill Apr 21, 2024
1f06588
Pass None for uneval inputs instead of default
guill Apr 21, 2024
2dda3f2
Add a test for mixed node expansion
guill Apr 21, 2024
06f3ce9
Raise exception for bad get_node calls.
guill Apr 21, 2024
b3e547f
Merge branch 'master' into execution_model_inversion
guill Apr 22, 2024
fa48ad3
Minor refactor of IsChangedCache.get
guill Apr 22, 2024
afa4c7b
Refactor `map_node_over_list` function
guill Apr 22, 2024
8d17f3c
Fix ui output for duplicated nodes
guill Jun 17, 2024
9d62456
Merge branch 'master' into execution_model_inversion
guill Jun 17, 2024
4712df8
Add documentation on `check_lazy_status`
guill Jun 17, 2024
85d046b
Merge branch 'master' into execution_model_inversion
guill Jul 21, 2024
48d03c4
Add file for execution model unit tests
guill Jul 21, 2024
64e3a43
Clean up Javascript code as per review
guill Aug 2, 2024
bb5de4d
Improve documentation
guill Aug 2, 2024
c4666bf
Add a new unit test for mixed lazy results
guill Aug 2, 2024
887ceb3
Merge branch 'master' into execution_model_inversion
guill Aug 2, 2024
655548d
Merge branch 'master' into execution_model_inversion
guill Aug 7, 2024
36131f0
Allow kwargs in VALIDATE_INPUTS functions
guill Aug 8, 2024
fd7229e
List cached nodes in `execution_cached` message
guill Aug 8, 2024
e73c917
Merge branch 'master' into execution_model_inversion
guill Aug 10, 2024
519d08e
Merge branch 'master' into execution_model_inversion
guill Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor refactor of IsChangedCache.get
  • Loading branch information
guill committed Apr 22, 2024
commit fa48ad3a1fcb45b0027eae58fdab073cb9f269ef
40 changes: 22 additions & 18 deletions execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,28 @@ def __init__(self, dynprompt, outputs_cache):
self.is_changed = {}

def get(self, node_id):
guill marked this conversation as resolved.
Show resolved Hide resolved
if node_id not in self.is_changed:
node = self.dynprompt.get_node(node_id)
class_type = node["class_type"]
class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
if hasattr(class_def, "IS_CHANGED"):
if "is_changed" in node:
self.is_changed[node_id] = node["is_changed"]
else:
input_data_all, _ = get_input_data(node["inputs"], class_def, node_id, self.outputs_cache)
try:
is_changed = map_node_over_list(class_def, input_data_all, "IS_CHANGED")
node["is_changed"] = [None if isinstance(x, ExecutionBlocker) else x for x in is_changed]
self.is_changed[node_id] = node["is_changed"]
except:
node["is_changed"] = float("NaN")
self.is_changed[node_id] = node["is_changed"]
else:
self.is_changed[node_id] = False
if node_id in self.is_changed:
return self.is_changed[node_id]

node = self.dynprompt.get_node(node_id)
class_type = node["class_type"]
class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
if not hasattr(class_def, "IS_CHANGED"):
self.is_changed[node_id] = False
return self.is_changed[node_id]

if "is_changed" in node:
self.is_changed[node_id] = node["is_changed"]
return self.is_changed[node_id]

input_data_all, _ = get_input_data(node["inputs"], class_def, node_id, self.outputs_cache)
try:
is_changed = map_node_over_list(class_def, input_data_all, "IS_CHANGED")
node["is_changed"] = [None if isinstance(x, ExecutionBlocker) else x for x in is_changed]
except:
node["is_changed"] = float("NaN")
finally:
self.is_changed[node_id] = node["is_changed"]
return self.is_changed[node_id]

class CacheSet:
Expand Down