> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-recommend-assets-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ノードの公開

## レジストリアカウントの設定

以下の手順に従って、レジストリアカウントを設定し、最初のノードを公開してください。

### チュートリアルを見る

<iframe height="415" src="https://www.youtube.com/embed/WhOZZOgBggU?si=6TyvhJJadmQ65uXC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style={{ width: "100%", borderRadius: "0.5rem" }} />

### パブリッシャーの作成

パブリッシャーは、レジストリにカスタムノードを公開できる識別情報です。すべてのカスタムノードには、pyproject.toml [ファイル]() にパブリッシャー識別子を含める必要があります。

[Comfy Registry](https://registry.comfy.org) にアクセスし、パブリッシャーアカウントを作成してください。パブリッシャー ID はグローバルに一意であり、後から変更することはできません。これはカスタムノードの URL に使用されるためです。

パブリッシャー ID は、プロフィールページの `@` 記号の後ろにあります。

<img className="block" src="https://mintcdn.com/dripart-docs-recommend-assets-api/72ldDrvzsIyIIl5f/images/publisherid.png?fit=max&auto=format&n=72ldDrvzsIyIIl5f&q=85&s=4fb76d2fa5f0d6c0b9fbb021a2a02d30" alt="Hero Dark" width="534" height="342" data-path="images/publisherid.png" />

### レジストリ公開用 API キーの作成

<Note>
  **重要:** この API キーは、**カスタムノードをレジストリおよび ComfyUI-Manager に公開するため**のものです。ワークフローで有料の API ノードを使用したい場合は、[API ノードの概要](/tutorials/partner-nodes/overview) を参照してください。
</Note>

[こちら](https://registry.comfy.org/nodes) にアクセスし、API キーを作成したいパブリッシャーをクリックしてください。このキーは、CLI または GitHub Actions を介してカスタムノードをレジストリ（ComfyUI-Manager を動かすもの）に公開するために使用されます。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/72ldDrvzsIyIIl5f/images/pat-1.png?fit=max&auto=format&n=72ldDrvzsIyIIl5f&q=85&s=3247b6163b0ba6bda730de87c9d9e1d2" alt="特定のパブリッシャー用のキーを作成" width="295" height="159" data-path="images/pat-1.png" />

API キーに名前を付け、安全な場所に保存してください。紛失した場合、新しいキーを作成する必要があります。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/72ldDrvzsIyIIl5f/images/pat-2.png?fit=max&auto=format&n=72ldDrvzsIyIIl5f&q=85&s=a55e722b5862924ce6c0c3c82095253c" alt="API キーを作成" width="526" height="474" data-path="images/pat-2.png" />

### メタデータの追加

<Tip>comfy-cli はインストール済みですか？[まずはこちらを実行してください](/comfy-cli/getting-started)。</Tip>

```bash theme={null}
comfy node init
```

このコマンドは、以下のメタデータを生成します：

```toml theme={null}
# 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 ファイルの詳細については、[仕様](/registry/specifications) を確認してください。

## レジストリへの公開

### オプション 1: Comfy CLI

以下のコマンドを実行して、ノードを手動でレジストリに公開します。

```bash theme={null}
comfy node publish
```

API キーの入力を求められます。

```bash theme={null}
API Key for publisher '<publisher id>': ****************************************************

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

<Warning>
  API キーはデフォルトで非表示であることを覚えておいてください。
</Warning>

<Warning>
  コピーペースト時、CTRL+V (Windows) を使用すると、末尾に余分な \x16 が付くことがあります。例：\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\x16。

  API キーは右クリックしてコピーペーストすることをお勧めします。
</Warning>

### オプション 2: Github Actions

Github Actions を使用してノードを自動公開します。

<Steps>
  <Step title="Github Secret の設定">
    Settings -> Secrets and Variables -> Actions -> Under Secrets Tab and Repository secrets -> New Repository Secret に移動します。

    `REGISTRY_ACCESS_TOKEN` という名前のシークレットを作成し、値として API キーを保存します。
  </Step>

  <Step title="Github Action の作成">
    以下のコードをコピーし、`/.github/workflows/publish_action.yml` に貼り付けます。

    ```bash theme={null}
    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.
    ```

    <Warning>作業ブランチの名前が `main` 以外の場合（例：`master`）、branches セクションに名前を追加してください。</Warning>
  </Step>

  <Step title="Github Action のテスト">
    `pyproject.toml` のバージョン番号を更新してプッシュしてください。レジストリに更新されたノードが表示されるはずです。

    <Tip>Github Action は、`pyproject.toml` ファイルを更新してプッシュするたびに自動実行されます。</Tip>
  </Step>
</Steps>
