Files
malkuthro-ComfyUI-Koolook/docs/maintainers/registry-api.md
T
malkuthroandClaude Opus 4.7 ee8ccefdf8 docs(reorg) + chore: roll [Unreleased] forward + bump 0.1.7 (#37)
Bundles two changes for v0.1.7:

1. PR #36 (already on main, just rolling [Unreleased] -> [0.1.7]):
   suffix all node display names with " (Koolook)" so they group
   together in ComfyUI's node-add search. Class IDs unchanged.

2. Docs reorg:
   - git mv Glossary.md            -> docs/reference/glossary.md
   - git mv RELEASING.md           -> docs/maintainers/releasing.md
   - Three audience buckets under docs/: user_guide/ (end users),
     reference/ (lookups), maintainers/ (project ops). Each gets a
     short index README.md.
   - Top-level docs/README.md as the navigation entry point.
   - New: docs/maintainers/registry-api.md captures the Comfy Registry
     undocumented version-management API (deprecate/yank/status enum,
     auto-deprecation behavior, curl recipes, optional GH Actions
     workflow YAML for codified mgmt without exposing the token).
   - New: docs/maintainers/node-versioning.md codifies the rules from
     the v0.1.5 PR-review discussion for changing INPUT_TYPES /
     RETURN_TYPES / class names without breaking saved workflows.
   - Imported the existing untracked docs/ images that the maintainer
     started locally (node inventory screenshot, Easy Image Batch
     helper image).
   - Cross-references updated in README.md, CLAUDE.md, the issue
     template, and .claude/skills/add-external-fork/SKILL.md.

Root drops from 6 -> 4 markdown files. The four that stay (README,
LICENSE, CHANGELOG, CLAUDE.md) are the ones that *must* live there for
GitHub / Comfy Registry / tooling / Claude Code reasons.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 23:26:46 +02:00

208 lines
7.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Comfy Registry — version-management API
**Status:** undocumented at [docs.comfy.org](https://docs.comfy.org/), but
the endpoints are stable and we've used them in anger. This doc captures
what we discovered while cleaning up `koolook` v0.1.0–0.1.5.
## TL;DR
You can deprecate, undeprecate, or yank a published version of your node
pack via authenticated HTTP requests against `api.comfy.org`. The same
`REGISTRY_ACCESS_TOKEN` that publishes nodes also authorizes management.
docs.comfy.org doesn't mention this, but `OPTIONS` probes confirm the
methods exist and return the expected results when used.
## Endpoints
| Method | Path | Purpose | Auth |
|---|---|---|---|
| `GET` | `/nodes/<node>/versions` | List published versions for a node (public) | none |
| `GET` | `/nodes/<node>/versions/<v>` | Inspect one version (public) | none |
| `OPTIONS` | `/publishers/<id>/nodes/<node>/versions/<v>` | Discover allowed methods on the management endpoint | none |
| `PUT` | `/publishers/<id>/nodes/<node>/versions/<v>` | Update fields on a version (currently `deprecated: bool`) | Bearer token |
| `DELETE` | `/publishers/<id>/nodes/<node>/versions/<v>` | Yank a version (status flips to `NodeVersionStatusDeleted`) | Bearer token |
For `koolook`, that's:
- `<id>` = `kforgelabs`
- `<node>` = `koolook`
## Auth
Use the same personal access token that publishes nodes. We store it as a
GitHub Secret named `REGISTRY_ACCESS_TOKEN` in this repo. Header format:
```
Authorization: Bearer $REGISTRY_ACCESS_TOKEN
```
If you don't have the token locally and don't want to expose it to your
shell history, the cleanest path is the GitHub Actions workflow at the
bottom of this doc.
## Status enum values observed
| Value | Meaning |
|---|---|
| `NodeVersionStatusPending` | In moderation queue. Not yet installable, not yet listed publicly. |
| `NodeVersionStatusActive` | Live and installable via Manager / `comfy node install`. |
| `NodeVersionStatusFlagged` | Flagged by automated scanner. May still be visible but generally hidden from normal install flows. |
| `NodeVersionStatusDeleted` | Yanked. No longer installable. The historical record (download URL, metadata) often still resolves on `GET` for archival purposes. |
## Auto-deprecation observed
When a new version of a node publishes, **prior versions automatically get
`deprecated: true`** with no explicit action from the publisher. We saw
this happen across `koolook` 0.1.2–0.1.4 the moment 0.1.5 went up. So you
generally don't need to deprecate by hand — just publishing the next
version handles it.
You'd only need to manually deprecate or yank if:
- A version shipped with content that should never be installed fresh
(license violation, security issue, broken metadata) and you want to
pre-empt the auto-deprecation by yanking before the next release ships.
- You're cleaning up a long tail of old test-published versions.
## Recipes
### Inspect a version
```bash
curl -sS https://api.comfy.org/nodes/koolook/versions/0.1.5 | jq .
```
### Discover allowed methods
```bash
curl -sS -i -X OPTIONS \
https://api.comfy.org/publishers/kforgelabs/nodes/koolook/versions/0.1.5 \
| grep -i '^allow:'
# Expected: allow: OPTIONS, DELETE, PUT
```
### Deprecate a version
```bash
curl -sS -X PUT \
-H "Authorization: Bearer $REGISTRY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"deprecated": true}' \
https://api.comfy.org/publishers/kforgelabs/nodes/koolook/versions/0.1.4
```
### Undeprecate (rare — only if you mistakenly deprecated something)
```bash
curl -sS -X PUT \
-H "Authorization: Bearer $REGISTRY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"deprecated": false}' \
https://api.comfy.org/publishers/kforgelabs/nodes/koolook/versions/0.1.4
```
### Yank (delete) a version
⚠️ **Irreversible.** Verify the version first; verify it's not
the only published version (you don't want to leave the node with no
installable versions); verify nothing critical depends on it being
present.
```bash
curl -sS -X DELETE \
-H "Authorization: Bearer $REGISTRY_ACCESS_TOKEN" \
https://api.comfy.org/publishers/kforgelabs/nodes/koolook/versions/0.1.0
```
## Optional: a GitHub Actions workflow that keeps the token off your shell
Drop this into `.github/workflows/registry-mgmt.yml` if you want a
codified, repeatable way to deprecate/yank versions without ever pasting
the token into a terminal. Trigger via
`gh workflow run registry-mgmt.yml -f version=0.1.4 -f action=deprecate`
(or via the Actions UI).
```yaml
name: Comfy Registry — version management
on:
workflow_dispatch:
inputs:
version:
description: "Version to act on (e.g. 0.1.4)"
required: true
type: string
action:
description: "Action"
required: true
type: choice
options: [deprecate, undeprecate, delete]
permissions: {}
jobs:
manage:
if: ${{ github.repository_owner == 'malkuthro' }}
runs-on: ubuntu-latest
steps:
- name: Show current state
run: |
curl -sS \
"https://api.comfy.org/nodes/koolook/versions/${{ inputs.version }}" \
| jq .
- name: Execute
env:
TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
BASE: "https://api.comfy.org/publishers/kforgelabs/nodes/koolook/versions/${{ inputs.version }}"
run: |
case "${{ inputs.action }}" in
deprecate) BODY='{"deprecated": true}' METHOD=PUT ;;
undeprecate) BODY='{"deprecated": false}' METHOD=PUT ;;
delete) BODY='' METHOD=DELETE ;;
esac
if [ -n "$BODY" ]; then
curl -sS -X "$METHOD" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "$BODY" "$BASE"
else
curl -sS -X "$METHOD" \
-H "Authorization: Bearer $TOKEN" "$BASE"
fi
- name: Confirm new state
run: |
curl -sS \
"https://api.comfy.org/nodes/koolook/versions/${{ inputs.version }}" \
| jq .
```
This workflow file is **not committed today** — auto-deprecation has been
sufficient for our cleanup needs. Add it if and when manual yanks become
routine.
## What docs.comfy.org *does* document
For comparison, [the official publishing doc](https://docs.comfy.org/registry/publishing)
covers:
- Creating a publisher account and personal access token
- The required `pyproject.toml` `[project]` and `[tool.comfy]` fields
- The standard `publish.yml` GitHub Actions workflow that runs on push to `main`
- A note about the Windows CTRL+V `\x16` trap when pasting tokens
What it doesn't cover (and why this doc exists): version-management
endpoints, status enum values, auto-deprecation behavior, the OPTIONS
probe technique for discovering undocumented endpoints, programmatic
yank.
## Caveats
- These endpoints are undocumented. Comfy could change or remove them
without warning. Re-probe with `OPTIONS` if a recipe stops working.
- The exact `PUT` body schema is empirically `{"deprecated": bool}` —
there may be other writable fields we haven't discovered. Probe with a
GET first to see the full record shape.
- "Auto-deprecation when a newer version publishes" is observed
behavior, not documented promise. Don't rely on it for security-
critical situations — yank explicitly if a version must not be
installable.