# Agents ## Adding a new extension When asked to add a new ComfyUI extension, update the following three files **in alphabetical order** by the extension slug / GitHub owner: ### 1. `extensions.sh` Add an `install_extension` call: ```sh install_extension https://github.com//.git ``` - `` is lowercase, hyphen-separated (e.g. `comfyui-seedvr2-videoupscaler`). - Keep entries sorted alphabetically by slug. ### 2. `requirements.in` Add a block in the `CUSTOM NODES` section, sorted alphabetically by slug: ```plain # # https://github.com// -r "https://raw.githubusercontent.com///refs/heads/main/requirements.txt" ``` - If the repository has no `requirements.txt`, leave the `-r` line commented out (`#-r ""`). - If the extension needs extra packages not in its `requirements.txt`, add them on the lines immediately after the `-r` line (see `comfyui-ipadapter-plus` for an example). - After editing `requirements.in`, regenerate the lock file: `task lock`. ### 3. `README.md` Add a row to the `## Pre-installed extensions` table, sorted alphabetically by GitHub owner: ```markdown | [/](https://github.com//) | . | ``` Align the columns to match the surrounding rows (use spaces to pad to the same column widths). --- ## Patching an extension When an extension needs a local fix that isn't upstream yet, don't fork it — add a patch under `patches//` instead. See `patches/README.md` for the format. It's applied automatically by `patch_extension` (called from `install_extension` in `entrypoint.sh`) on every install/update, so no wiring is needed elsewhere. ```sh git diff > patches//001-short-description.patch ``` --- ### Checklist - [ ] `extensions.sh` — `install_extension` line added in alphabetical order - [ ] `requirements.in` — dependency block added in alphabetical order - [ ] `pylock.toml` regenerated via `task lock` - [ ] `README.md` — table row added in alphabetical order