mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-01-27 22:40:22 +08:00
Compare commits
3 Commits
60e657be3a
...
7f2f85c86b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f2f85c86b | ||
|
|
4941fb8aa0 | ||
|
|
e7d4ea76d7 |
@ -694,5 +694,15 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "View Image Metadata of ComfyUI as well as of ForgeUI or Automatic 1111 generated images in Easily Readable Format"
|
||||
}
|
||||
{
|
||||
"author": "DNPMBHC",
|
||||
"title": "ComfyUI-ZiYu_LabelKit",
|
||||
"reference": "https://github.com/DNPMBHC/ComfyUI-ZiYu_LabelKit",
|
||||
"files": [
|
||||
"https://github.com/DNPMBHC/ComfyUI-ZiYu_LabelKit"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A lightweight ComfyUI custom node that batch-loads images and extracts filenames simultaneously to accelerate labeling workflows."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
14
scanner.py
14
scanner.py
@ -105,10 +105,17 @@ def extract_nodes(code_text):
|
||||
warnings.filterwarnings('ignore', category=DeprecationWarning)
|
||||
parsed_code = ast.parse(code_text)
|
||||
|
||||
assignments = (node for node in parsed_code.body if isinstance(node, ast.Assign))
|
||||
# Support both ast.Assign and ast.AnnAssign (for type-annotated assignments)
|
||||
assignments = (node for node in parsed_code.body if isinstance(node, (ast.Assign, ast.AnnAssign)))
|
||||
|
||||
for assignment in assignments:
|
||||
if isinstance(assignment.targets[0], ast.Name) and assignment.targets[0].id in ['NODE_CONFIG', 'NODE_CLASS_MAPPINGS']:
|
||||
# Handle ast.AnnAssign (e.g., NODE_CLASS_MAPPINGS: Type = {...})
|
||||
if isinstance(assignment, ast.AnnAssign):
|
||||
if isinstance(assignment.target, ast.Name) and assignment.target.id in ['NODE_CONFIG', 'NODE_CLASS_MAPPINGS']:
|
||||
node_class_mappings = assignment.value
|
||||
break
|
||||
# Handle ast.Assign (e.g., NODE_CLASS_MAPPINGS = {...})
|
||||
elif isinstance(assignment.targets[0], ast.Name) and assignment.targets[0].id in ['NODE_CONFIG', 'NODE_CLASS_MAPPINGS']:
|
||||
node_class_mappings = assignment.value
|
||||
break
|
||||
else:
|
||||
@ -228,7 +235,8 @@ def scan_in_file(filename, is_builtin=False):
|
||||
with open(filename, encoding='utf-8', errors='ignore') as file:
|
||||
code = file.read()
|
||||
|
||||
pattern = r"_CLASS_MAPPINGS\s*=\s*{([^}]*)}"
|
||||
# Support type annotations (e.g., NODE_CLASS_MAPPINGS: Type = {...}) and line continuations (\)
|
||||
pattern = r"_CLASS_MAPPINGS\s*(?::\s*\w+\s*)?=\s*(?:\\\s*)?{([^}]*)}"
|
||||
regex = re.compile(pattern, re.MULTILINE | re.DOTALL)
|
||||
|
||||
nodes = set()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user