(self, node_id)
| 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 | |
| 101 | class CacheEntry(NamedTuple): |
nothing calls this directly
no test coverage detected