fix: scope input-scanning loop inside per-node try/except in extract_models_from_prompt
If INPUT_TYPES() succeeded but returned a non-dict, the inner loop calling input_types.get() would raise AttributeError outside the guard, aborting model tracking for the entire prompt. Moving the loop inside the try/except means only the offending node is skipped via continue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -159,24 +159,23 @@ class ModelMapper:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
input_types = node_cls.INPUT_TYPES()
|
input_types = node_cls.INPUT_TYPES()
|
||||||
|
for category in ("required", "optional"):
|
||||||
|
for input_name, input_def in input_types.get(category, {}).items():
|
||||||
|
if not isinstance(input_def, (list, tuple)) or not input_def:
|
||||||
|
continue
|
||||||
|
# ComfyUI folder dropdowns have a list as their type
|
||||||
|
if not isinstance(input_def[0], list):
|
||||||
|
continue
|
||||||
|
value = node_inputs.get(input_name)
|
||||||
|
if not isinstance(value, str) or value in seen:
|
||||||
|
continue
|
||||||
|
model_type = self.get_model_type(value)
|
||||||
|
if model_type:
|
||||||
|
seen.add(value)
|
||||||
|
results.append((value, model_type))
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for category in ("required", "optional"):
|
|
||||||
for input_name, input_def in input_types.get(category, {}).items():
|
|
||||||
if not isinstance(input_def, (list, tuple)) or not input_def:
|
|
||||||
continue
|
|
||||||
# ComfyUI folder dropdowns have a list as their type
|
|
||||||
if not isinstance(input_def[0], list):
|
|
||||||
continue
|
|
||||||
value = node_inputs.get(input_name)
|
|
||||||
if not isinstance(value, str) or value in seen:
|
|
||||||
continue
|
|
||||||
model_type = self.get_model_type(value)
|
|
||||||
if model_type:
|
|
||||||
seen.add(value)
|
|
||||||
results.append((value, model_type))
|
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def invalidate(self):
|
def invalidate(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user