在ComfyUI发布节点

创建一个ComfyUI-registry账号

Comfy Registry 注册账号

创建一个Publisher

「Publisher」是创建自定义节点的ID标识,一旦创建后不可以被修改

Hero Dark

创建一个API Key

链接,后续使用CLI工具上传文件需要用上

Create key for Specific Publisher

将APIKey保存好,它只显示一次

Create API Key

在节点文件中添加Meta信息

先安装comfy-cli

1
pip install comfy-cli

再进行初始化

1
comfy node init

这行代码会在节点项目中生成pyproject.toml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# pyproject.toml
[project]
name = "" # Unique identifier for your node. Immutable after creation.
description = ""
version = "1.0.0" # Custom Node version. Must be semantically versioned.
license = { file = "LICENSE.txt" }
dependencies = [] # Filled in from requirements.txt

[project.urls]
Repository = "https://github.com/..."

[tool.comfy]
PublisherId = "" # TODO (fill in Publisher ID from Comfy Registry Website).
DisplayName = "" # Display name for the Custom Node. Can be changed later.
Icon = "https://example.com/icon.png" # SVG, PNG, JPG or GIF (MAX. 800x400px)

查看pyproject.toml的更多信息:链接

公开到Comfy-Registry

方式一: Comfy CLI

每次手动运行下方的代码

1
comfy node publish

随后被要求输入API Key

1
2
3
4
API Key for publisher '<publisher id>': ****************************************************

...Version 1.0.0 Published.
See it here: https://registry.comfy.org/publisherId/your-node

方式二: Github Actions

每次自动更新到comfy-registry,这需要用到GitHub Actions

创建一个Github Secret

找到 Settings -> Secrets and Variables -> Actions -> Under Secrets Tab and Repository secrets -> New Repository Secret.

名字(name): REGISTRY_ACCESS_TOKEN

值(value):``API key`(在Comfy-registry创建的)

创建一个Github Action

将下面的代码复制到项目的: /.github/workflows/publish_action.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"

jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} ## Add your own personal access token to your Github Repository secrets and reference it here.

如果你的项目拥有除main外的其它分支,如master,也需要将它添加到publish_action.ymlbranches

测试Github Action

更新pyproject.toml的版本号,检查是否已经推着到comfy-registry成功