Add support for DISPLAY_NAME in custom nodes

as an alternative to NODE_DISPLAY_NAME_MAPPINGS
This commit is contained in:
Elias Hogstvedt 2024-01-25 08:21:33 +07:00
parent d1533d9c0f
commit 4102ff1951

View File

@ -400,7 +400,7 @@ class PromptServer():
info['output_is_list'] = obj_class.OUTPUT_IS_LIST if hasattr(obj_class, 'OUTPUT_IS_LIST') else [False] * len(obj_class.RETURN_TYPES)
info['output_name'] = obj_class.RETURN_NAMES if hasattr(obj_class, 'RETURN_NAMES') else info['output']
info['name'] = node_class
info['display_name'] = nodes.NODE_DISPLAY_NAME_MAPPINGS[node_class] if node_class in nodes.NODE_DISPLAY_NAME_MAPPINGS.keys() else node_class
info['display_name'] = obj_class.DISPLAY_NAME if hasattr(obj_class,'DISPLAY_NAME') else nodes.NODE_DISPLAY_NAME_MAPPINGS[node_class] if node_class in nodes.NODE_DISPLAY_NAME_MAPPINGS.keys() else node_class
info['description'] = obj_class.DESCRIPTION if hasattr(obj_class,'DESCRIPTION') else ''
info['category'] = 'sd'
if hasattr(obj_class, 'OUTPUT_NODE') and obj_class.OUTPUT_NODE == True: