MCPcopy Create free account
hub / github.com/Comfy-Org/ComfyUI / get

Method get

execution.py:64–98  ·  view source on GitHub ↗
(self, node_id)

Source from the content-addressed store, hash-verified

62 self.is_changed = {}
63
64 async def get(self, node_id):
65 if node_id in self.is_changed:
66 return self.is_changed[node_id]
67
68 node = self.dynprompt.get_node(node_id)
69 class_type = node["class_type"]
70 class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
71 has_is_changed = False
72 is_changed_name = None
73 if issubclass(class_def, _ComfyNodeInternal) and first_real_override(class_def, "fingerprint_inputs") is not None:
74 has_is_changed = True
75 is_changed_name = "fingerprint_inputs"
76 elif hasattr(class_def, "IS_CHANGED"):
77 has_is_changed = True
78 is_changed_name = "IS_CHANGED"
79 if not has_is_changed:
80 self.is_changed[node_id] = False
81 return self.is_changed[node_id]
82
83 if "is_changed" in node:
84 self.is_changed[node_id] = node["is_changed"]
85 return self.is_changed[node_id]
86
87 # Intentionally do not use cached outputs here. We only want constants in IS_CHANGED
88 input_data_all, _, v3_data = get_input_data(node["inputs"], class_def, node_id, None)
89 try:
90 is_changed = await _async_map_node_over_list(self.prompt_id, node_id, class_def, input_data_all, is_changed_name, v3_data=v3_data)
91 is_changed = await resolve_map_node_over_list_results(is_changed)
92 node["is_changed"] = [None if isinstance(x, ExecutionBlocker) else x for x in is_changed]
93 except Exception as e:
94 logging.warning("WARNING: {}".format(e))
95 node["is_changed"] = float("NaN")
96 finally:
97 self.is_changed[node_id] = node["is_changed"]
98 return self.is_changed[node_id]
99
100
101class CacheEntry(NamedTuple):

Callers

nothing calls this directly

Calls 6

first_real_overrideFunction · 0.90
get_input_dataFunction · 0.85
get_nodeMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected