> ## 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.

# pyproject.toml

# 仕様

`pyproject.toml` ファイルには、ComfyUI カスタムノード用の 2 つの主要セクション `[project]` と `[tool.comfy]` が含まれています。以下に各セクションの仕様を示します。

## \[project] セクション

### name（必須）

ノード ID はカスタムノードを一意に識別し、レジストリからの URL で使用されます。ユーザーはこの名前を参照してノードをインストールできます：

```bash theme={null}
comfy node install <node-id>
```

**要件:**

* 100 文字未満であること
* 英数字、ハイフン、アンダースコア、ピリオドのみ含めることができる
* 連続した特殊文字を含めることはできない
* 数字または特殊文字で始まることはできない
* 大文字小文字を区別しない比較

**ベストプラクティス:**

* 短く説明的な名前を使用する
* 名前に「ComfyUI」を含めない
* 記憶しやすく入力しやすい名前にする

**例:**

```toml theme={null}
name = "image-processor"      # ✅ 良い：シンプルで明確
name = "super-resolution"     # ✅ 良い：機能を説明している
name = "ComfyUI-enhancer"    # ❌ 悪い：ComfyUI を含んでいる
name = "123-tool"            # ❌ 悪い：数字で始まっている
```

詳細については、[公式 Python ドキュメント](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#name) をご覧ください。

### version（必須）

[セマンティックバージョニング](https://semver.org/) を使用し、3 桁のバージョン番号 X.Y.Z を採用します：

* X（**MAJOR**）: 破壊的変更
* Y（**MINOR**）: 新機能（後方互換性あり）
* Z（**PATCH**）: バグ修正

**例:**

```toml theme={null}
version = "1.0.0"    # 初期リリース
version = "1.1.0"    # 新機能追加
version = "1.1.1"    # バグ修正
version = "2.0.0"    # 破壊的変更
```

### license（オプション）

カスタムノードのライセンスを指定します。2 つの方法で指定できます：

1. **ファイル参照:**

```toml theme={null}
license = { file = "LICENSE" }     # ✅ LICENSE ファイルを指す
license = { file = "LICENSE.txt" } # ✅ LICENSE.txt を指す
license = "LICENSE"                # ❌ 形式が正しくない
```

2. **ライセンス名:**

```toml theme={null}
license = { text = "MIT License" }  # ✅ 正しい形式
license = { text = "Apache-2.0" }   # ✅ 正しい形式
license = "MIT LICENSE"             # ❌ 形式が正しくない
```

一般的なライセンス：[MIT](https://opensource.org/license/mit)、[GPL](https://www.gnu.org/licenses/gpl-3.0.en.html)、[Apache](https://www.apache.org/licenses/LICENSE-2.0)

### description（推奨）

カスタムノードの機能に関する簡単な説明。

```toml theme={null}
description = "A super resolution node for enhancing image quality"
```

### repository（必須）

関連リソースへのリンク：

```toml theme={null}
[project.urls]
Repository = "https://github.com/username/repository"
```

### urls（推奨）

関連リソースへのリンク：

```toml theme={null}
[project.urls]
Documentation = "https://github.com/username/repository/wiki"
"Bug Tracker" = "https://github.com/username/repository/issues"
```

### requires-python（推奨）

ノードがサポートする Python バージョンを指定します：

```toml theme={null}
requires-python = ">=3.8"        # Python 3.8 以上
requires-python = ">=3.8,<3.11"  # Python 3.8 以上 3.11 未満
```

### フロントエンドバージョン互換性（オプション）

ノードがサポートする ComfyUI フロントエンドバージョンに特定の要件がある場合、`comfyui-frontend-package` 依存関係を使用してこれを指定できます。このパッケージは [PyPI](https://pypi.org/project/comfyui-frontend-package/) で公開されています。

以下の場合にこのフィールドを使用します：

* カスタムノードが特定のバージョンで導入されたフロントエンド API を使用している
* ノードと特定のフロントエンドバージョン間の非互換性を特定した
* ノードが新しいフロントエンドバージョンでのみ利用可能な特定の UI 機能を必要としている

```toml theme={null}
[project]
dependencies = [
    "comfyui-frontend-package>=1.20.0"       # フロントエンド 1.20.0 以上が必要
    "comfyui-frontend-package<=1.21.6"       # フロントエンドバージョンを 1.21.6 までに制限
    "comfyui-frontend-package>=1.19,<1.22"   # フロントエンド 1.19 から 1.21.x で動作
    "comfyui-frontend-package~=1.20.0"       # 1.20.x と互換性あり、1.21.0 は含まない
    "comfyui-frontend-package!=1.21.3"       # 1.21.3 以外のすべてのバージョンで動作
]
```

### classifiers（推奨）

分類子を使用して、オペレーティングシステムの互換性と GPU アクセラレータを指定します。この情報は、ユーザーがシステムに適したノードを見つけるのに役立ちます。

```toml theme={null}
[project]
classifiers = [
    # OS 依存しないノード用（すべてのオペレーティングシステムで動作）
    "Operating System :: OS Independent",

    # または OS 固有のノードの場合、サポートされるシステムを指定：
    "Operating System :: Microsoft :: Windows",  # Windows 固有
    "Operating System :: POSIX :: Linux",  # Linux 固有
    "Operating System :: MacOS",  # macOS 固有
    
    # GPU アクセラレータサポート
    "Environment :: GPU :: NVIDIA CUDA",    # NVIDIA CUDA サポート
    "Environment :: GPU :: AMD ROCm",       # AMD ROCm サポート
    "Environment :: GPU :: Intel Arc",      # Intel Arc サポート
    "Environment :: NPU :: Huawei Ascend",  # 華為昇騰サポート
    "Environment :: GPU :: Apple Metal",    # Apple Metal サポート
]
```

## \[tool.comfy] セクション

### PublisherId（必須）

一意の発行元識別子。通常、GitHub ユーザー名と一致します。

**例:**

```toml theme={null}
PublisherId = "john-doe"        # ✅ GitHub ユーザー名と一致
PublisherId = "image-wizard"    # ✅ 一意の識別子
```

### DisplayName（オプション）

カスタムノードのユーザーフレンドリーな名前。

```toml theme={null}
DisplayName = "Super Resolution Node"
```

### Icon（オプション）

ComfyUI レジストリと ComfyUI-Manager に表示されるカスタムノードのアイコンへの URL。

**要件:**

* ファイル形式：SVG、PNG、JPG、または GIF
* 最大解像度：400px × 400px
* アスペクト比は正方形であること

```toml theme={null}
Icon = "https://raw.githubusercontent.com/username/repo/main/icon.png"
```

### Banner（オプション）

ComfyUI レジストリと ComfyUI-Manager に表示される大きなバナー画像への URL。

**要件:**

* ファイル形式：SVG、PNG、JPG、または GIF
* アスペクト比：21:9

```toml theme={null}
Banner = "https://raw.githubusercontent.com/username/repo/main/banner.png"
```

### requires-comfyui（オプション）

ノードが互換性のある ComfyUI バージョンを指定します。これにより、ユーザーが正しいバージョンの ComfyUI をインストールしていることを確認するのに役立ちます。

**サポートされる演算子:** `<`、`>`、`<=`、`>=`、`~=`、`<>`、`!=` および範囲

```toml theme={null}
requires-comfyui = ">=1.0.0"        # ComfyUI 1.0.0 以上
requires-comfyui = ">=1.0.0,<2.0.0"  # ComfyUI 1.0.0 以上 2.0.0 未満
requires-comfyui = "~=1.0.0"         # 互換リリース：バージョン 1.0.0 以上、ただし 2.0.0 は含まない
requires-comfyui = "!=1.2.3"         # 1.2.3 以外のすべてのバージョン
requires-comfyui = ">0.1.3,<1.0.0"   # 0.1.3 より大きく 1.0.0 より小さい
```

### includes（オプション）

特定のフォルダーを強制的に含めるかどうかを指定します。フロントエンドプロジェクトのカスタムノードなど、一部の状況では、最終的なパッケージ出力フォルダーが .gitignore に含まれている可能性があります。そのような場合、レジストリ使用のために強制的に含める必要があります。

```toml theme={null}
includes = ['dist']
```

## 完全な例

```toml theme={null}
[project]
name = "super-resolution-node"
version = "1.0.0"
description = "Enhance image quality using advanced super resolution techniques"
license = { file = "LICENSE" }
requires-python = ">=3.8"
dependencies = [
    "comfyui-frontend-package<=1.21.6"  # フロントエンドバージョン互換性
]
classifiers = [
    "Operating System :: OS Independent"  # すべてのオペレーティングシステムで動作
]
dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[project.urls]
Repository = "https://github.com/username/super-resolution-node"
Documentation = "https://github.com/username/super-resolution-node/wiki"
"Bug Tracker" = "https://github.com/username/super-resolution-node/issues"

[tool.comfy]
PublisherId = "image-wizard"
DisplayName = "Super Resolution Node"
Icon = "https://raw.githubusercontent.com/username/super-resolution-node/main/icon.png"
Banner = "https://raw.githubusercontent.com/username/super-resolution-node/main/banner.png"
requires-comfyui = ">=1.0.0"  # ComfyUI バージョン互換性
```
