Comfy-Org / Comfy-Org/workflow_templates

Site builds from the Hub API, but 193 of 581 repo templates (33%) have no Hub entry

Open
#1,135 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
901
Forks
188
Avg merge
23h 10m
Merged PRs (30d)
86

Description

## Summary

The site under `site/` (comfy.org/workflows) is built from the **Hub API**, not from this repo's `templates/*.json`. That distinction matters right now because GTM is being asked to point "download this workflow" links at the Hub instead of at GitHub — and today ~33% of the templates in this repo have no Hub entry, so they have no Hub page to link to.

## Where the site's data actually comes from

Hub API is the build-time source:

- `site/src/pages/workflows/[slug].astro` — `getStaticPaths()` calls `listWorkflowIndex()`
- `site/src/lib/hub-api.ts:276` — `GET {PUBLIC_HUB_API_URL}/api/hub/workflows/index?status=approved`
- `.github/workflows/deploy-site.yml`, `.github/workflows/cron-rebuild-site.yml` — production builds set `PUBLIC_HUB_API_URL` and `PUBLIC_APPROVED_ONLY=true`
- `site/src/pages/workflows/download/[shareId].json.ts` — `prerender = false`; the download button fetches `workflow_json` live from `GET /api/hub/workflows/{shareId}`. It never serves this repo's `templates/*.json`.

The repo-JSON path is a **local-dev fallback only**:

- `pnpm run sync` → `site/scripts/lib/sync.ts` → `site/scripts/lib/index-reader.ts` reads `templates/index.json` off disk into an Astro content collection
- `site/src/lib/hub-api.ts:551` (`loadSerializedTemplates`) throws rather than fall back when `PUBLIC_HUB_API_URL` is set — comment: *"no silent fallback to stale content collection data"*
- The sync step still contributes thumbnails, logos and avatars to `public/`

So for anything user-visible on comfy.org/workflows — slugs, cards, detail pages, downloads — the Hub API is already the source of truth. The repo remains source of truth for the templates that ship *inside ComfyUI* (the `comfyui_workflow_templates` PyPI package, `.github/workflows/publish.yml`).

## The coverage gap

Measured 2026-08-16 against `templates/index.json` @ `main` and the live index endpoint:

| | count |
|---|---|
| templates in `templates/index.json` | 581 |
| Hub index, `status=approved` | 609 |
| Hub index, all statuses | 633 |
| **repo templates with no Hub entry at any status** | **193 (33%)** |
| repo templates present in Hub but not `approved` | 6 |

Reproduce:

```bash
curl -s 'https://cloud.comfy.org/api/hub/workflows/index?status=pending,approved,rejected,deprecated' -o hub.json
curl -sL https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/index.json -o repo.json
python3 -c "
import json
r=json.load(open('repo.json')); h=json.load(open('hub.json'))
rn={t['name'] for c in r for t in c['templates']}; hn={e['name'] for e in h}
print(len(rn), len(hn), len(rn-hn))
print(sorted(rn-hn)[:20])
"
```

The missing set is heavily API-node and recent templates: `api_bfl_flux3_t2v`, `api_bfl_flux3_i2v`, `api_anthropic_claude*`, `api_beeble_*`, `api_bria_*`, `3d_moge_panorama_to_mesh`, `3d_triposplat_image_to_gaussian_splat`, …

Consequence — those templates 404 on the site:

```
https://comfy.org/workflows/api_bfl_flux3_t2v/ -> 404
https://comfy.org/workflows/flux_schnell/ -> 200
```

## Why the gap exists

I could find no repo→Hub push in `.github/workflows/` — nothing that registers a newly merged template with the Hub. Ingest appears to happen cloud-side, and it is lagging this repo. That is consistent with the missing set being dominated by newer `api_*` templates.

## Ask

1. Confirm what owns repo → Hub ingest, and whether it is automated or manual.
2. Close the 193-template gap, or define which templates are intentionally Hub-excluded (e.g. API-node templates) so "link to the Hub" has a documented exception list instead of silent 404s.
3. Add a CI check that fails (or at least warns) when a template lands in `templates/index.json` with no corresponding Hub entry after ingest — otherwise the gap re-opens with every batch of new templates.
4. Until 1–3 land, GTM links for the missing third have to keep pointing at GitHub; "point at the Hub systematically" is blocked on ingest coverage, not on a source-of-truth decision. For what the Hub site renders, the Hub API already *is* the source of truth.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the provided curl and Python comparison against templates/index.json and the Hub index, then inspect site/src/lib/hub-api.ts, the workflow pages, and .github/workflows/ for existing ingest or validation. Done means the repo-to-Hub ownership and exclusions are documented, missing entries are addressed or explained, and a CI warning or failure prevents the gap from silently reopening.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python, typescript
Domain
api, ci-cd, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.