Comfy-Org / Comfy-Org/ComfyUI_frontend

feat: migrate template dialog from static data to hub API (phased)

Open
#10,678 0 comments 0 reactions 1 assignee Claimed by @dante01yoon View on GitHub
area:templates enhancement
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Context

The template dialog currently uses a static `index.json` file as its data source. We want to migrate to the hub API (`GET /api/hub/workflows`) so that the database becomes the source of truth.

However, the current hub list API only supports `search` and `tag` (single) query parameters. The frontend template dialog relies on several filters that are not yet available server-side:

| Filter | Server support |
|---|---|
| Text search | ✅ `search` param |
| Tag (single) | ✅ `tag` param |
| Model filter (multi-select) | ❌ Not supported |
| Runs on (open source vs external) | ❌ Not supported |
| Sort (recommended, popular, newest, alphabetical, VRAM, model size) | ❌ Not supported |

Using server-side pagination with incomplete filter support would degrade the UX — client-side filters would only apply to the currently loaded page, producing incomplete results.

## Proposed Plan

### Phase 1 — Database as source of truth (frontend-driven filtering)

- Fetch all hub workflows via the list API (paginate through all pages on init)
- Keep all existing client-side filtering, sorting, and search (Fuse.js) unchanged
- This preserves the current UX while switching the data source from static files to the database
- Frontend work is ready; no backend changes needed
- **PR:** #10675

### Phase 2 — Server-side filtering and pagination (scalable)

- Backend adds missing filter/sort params: `model`, `open_source`, `sort`, multi-tag support
- Frontend switches to cursor-based pagination with server-side search and filtering
- Fuse.js and client-side filter logic removed for cloud
- This enables the dialog to scale to a large number of templates without loading everything upfront
- Blocked on backend API changes

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10678-feat-migrate-template-dialog-from-static-data-to-hub-API-phased-3316d73d365081f19f4fd5a116aec6ca) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.