8000 Remove comfyui related prefix from node names. by robinjhuang · Pull Request #220 · Comfy-Org/comfy-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove comfyui related prefix from node names. #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion comfy_cli/registry/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@ def create_comfynode_config():
raise Exception("Failed to write 'pyproject.toml'") from e


def sanitize_node_name(name: str) -> str:
"""Remove common ComfyUI-related prefixes from a string.

Args:
name: The string to process

Returns:
The string with any ComfyUI-related prefix removed
"""
name = name.lower()
prefixes = [
"comfyui-",
"comfyui_",
"comfy-",
"comfy_",
"comfy",
"comfyui",
]

for prefix in prefixes:
name = name.removeprefix(prefix)
return name


def initialize_project_config():
create_comfynode_config()

Expand All @@ -86,7 +110,7 @@ def initialize_project_config():
urls = project.get("urls", tomlkit.table())
urls["Repository"] = git_remote_url
project["urls"] = urls
project["name"] = repo_name.lower()
project["name"] = sanitize_node_name(repo_name)
project["description"] = ""
project["version"] = "1.0.0"

Expand Down
Loading
0