Skip to content

[feat] Implement getNodeByComfyNodeName API integration #4343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2025

Conversation

christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Jul 4, 2025

Adds support for the new backend route that finds node packs by ComfyUI node name, replacing usage of /nodes/search with comfy_nodes_search param. The performance is ~12x faster, going from 850ms to 70ms on average.

Details:

  • Replaces /nodes/search?comfy_nodes_search with /comfy-nodes/:nodeName/node
  • Integrates useCachedRequest wrapper for performance
  • Adds tests for new functions
  • The new route also has Cache-Control headers, so there is now 3-tiered cache (1) in-memory browser caching (<1ms) => (2) browser caching (<50ms) => (3) server in-memory caching (<100ms) => (4) DB call (~300ms-500ms)

✔️ Requires https://github.com/Comfy-Org/comfy-api/pull/531 to be deployed to prod (done).

Add support for the new backend route that finds node packs by ComfyUI node name.
This replaces the previous search-based approach with a direct API call that uses
the backend's ranking algorithm for better accuracy.

Key changes:
- Added inferPackFromNodeName method to comfyRegistryService with comprehensive JSDoc
- Integrated useCachedRequest wrapper in comfyRegistryStore for performance
- Updated useWorkflowPacks to use new API and handle 404 errors gracefully
- Added comprehensive test coverage for the new functionality

The new API provides better node-to-pack matching by using the backend's ranking
algorithm which considers preemption matches, search rankings, and install counts.
@christian-byrne christian-byrne requested review from a team as code owners July 4, 2025 00:09
@christian-byrne christian-byrne marked this pull request as draft July 4, 2025 00:09
@christian-byrne christian-byrne marked this pull request as ready for review July 4, 2025 00:19
@christian-byrne christian-byrne merged commit 44bbfa9 into main Jul 4, 2025
10 checks passed
@christian-byrne christian-byrne deleted the feature/infer-pack-from-node-name branch July 4, 2025 00:59
This was referenced Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant