Skip to content

Commit 5653a28

Browse files
author
coderfromthenorth93
committed
Parse banner url from toml file and send it to registry service while publishing a new node version
1 parent e22eaf7 commit 5653a28

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

comfy_cli/registry/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def publish_node_version(self, node_config: PyProjectConfig, token) -> PublishNo
5454
"name": node_config.tool_comfy.display_name,
5555
"license": license_json,
5656
"repository": node_config.project.urls.repository,
57+
"banner_url": node_config.tool_comfy.banner_url,
5758
"supported_os": node_config.project.supported_os,
5859
"supported_accelerators": node_config.project.supported_accelerators,
5960
"supported_comfyui_version": node_config.project.supported_comfyui_version,

comfy_cli/registry/config_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ def extract_node_configuration(
295295
icon=comfy_data.get("Icon", ""),
296296
models=[Model(location=m["location"], model_url=m["model_url"]) for m in comfy_data.get("Models", [])],
297297
includes=comfy_data.get("includes", []),
298+
banner_url=comfy_data.get("Banner", ""),
298299
)
299300

300301
return PyProjectConfig(project=project, tool_comfy=comfy)

comfy_cli/registry/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class ComfyConfig:
5252
icon: str = ""
5353
models: List[Model] = field(default_factory=list)
5454
includes: List[str] = field(default_factory=list)
55+
banner_url: str = ""
5556

5657

5758
@dataclass

tests/comfy_cli/registry/test_config_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def mock_toml_data():
3131
"Documentation": "https://docs.example.com",
3232
"Repository": "https://github.com/example/test-project",
3333
"Issues": "https://github.com/example/test-project/issues",
34+
"Banner": "https://example.com/banner.png",
3435
},
3536
},
3637
"tool": {
@@ -77,6 +78,7 @@ def test_extract_node_configuration_success(mock_toml_data):
7778
assert result.tool_comfy.publisher_id == "test-publisher"
7879
assert result.tool_comfy.display_name == "Test Project"
7980
assert result.tool_comfy.icon == "icon.png"
81+
assert result.tool_comfy.banner_url == "https://example.com/banner.png"
8082
assert len(result.tool_comfy.models) == 2
8183
assert result.tool_comfy.models[0] == Model(location="model1.bin", model_url="https://example.com/model1")
8284

0 commit comments

Comments
 (0)