MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / _format_description

Function _format_description

nodes_registry.py:123–146  ·  view source on GitHub ↗

Format nodes display name to a standard format

(
    description: str, class_name: str, experimental: bool, deprecated: bool
)

Source from the content-addressed store, hash-verified

121
122
123def _format_description(
124 description: str, class_name: str, experimental: bool, deprecated: bool
125) -> str:
126 """Format nodes display name to a standard format"""
127
128 # If description is not provided, auto-generate one based on the class name
129 if description is None:
130 description = camel_case_to_spaces(class_name)
131
132 # Strip the prefix if it's already there
133 prefix_len = len(NODES_DISPLAY_NAME_PREFIX)
134 if description.startswith(NODES_DISPLAY_NAME_PREFIX):
135 description = description[prefix_len:].lstrip()
136
137 # Add the deprecated / experimental prefixes
138 if deprecated:
139 description = f"{DEPRECATED_DISPLAY_NAME_PREFIX} {description}"
140 elif experimental:
141 description = f"{EXPERIMENTAL_DISPLAY_NAME_PREFIX} {description}"
142
143 # Add the prefix
144 description = f"{NODES_DISPLAY_NAME_PREFIX} {description}"
145
146 return description
147
148
149def camel_case_to_spaces(text: str) -> str:

Callers 1

decoratorFunction · 0.85

Calls 1

camel_case_to_spacesFunction · 0.85

Tested by

no test coverage detected