mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 10:59:53 +00:00
feat: Add search_aliases to node search (#8223)
Adds `search_aliases` to Fuse.js search keys, enabling users to find nodes by alternative names. https://github.com/user-attachments/assets/6bde3e5d-29c7-4cb0-b102-e600a92c7019 ## Changes - Add `search_aliases` to Fuse.js keys in `nodeSearchService.ts` - Add type definition for `search_aliases` field in `nodeDefSchema.ts` **Depends on:** Comfy-Org/ComfyUI#12010 ## Related PRs - **Backend:** Comfy-Org/ComfyUI#12010, https://github.com/Comfy-Org/ComfyUI/pull/12035/ - **Adding aliases**: - https://github.com/Comfy-Org/ComfyUI/pull/12016 - https://github.com/Comfy-Org/ComfyUI/pull/12017 - https://github.com/Comfy-Org/ComfyUI/pull/12018 - https://github.com/Comfy-Org/ComfyUI/pull/12019 - **Docs:** https://github.com/Comfy-Org/docs/pull/729 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8223-feat-Add-search_aliases-to-node-search-2ef6d73d365081d89bcccffb33659a88) by [Unito](https://www.unito.io) Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -269,6 +269,11 @@ export const zComfyNodeDef = z.object({
|
||||
* Keys are 'required', 'optional', etc., values are arrays of input names.
|
||||
*/
|
||||
input_order: z.record(z.array(z.string())).optional(),
|
||||
/**
|
||||
* Alternative names for search. Useful for synonyms, abbreviations,
|
||||
* or old names after renaming a node.
|
||||
*/
|
||||
search_aliases: z.array(z.string()).optional(),
|
||||
/**
|
||||
* Price badge definition for API nodes.
|
||||
* Contains a JSONata expression to calculate pricing based on widget values
|
||||
|
||||
@@ -14,7 +14,7 @@ export class NodeSearchService {
|
||||
constructor(data: ComfyNodeDefImpl[]) {
|
||||
this.nodeFuseSearch = new FuseSearch(data, {
|
||||
fuseOptions: {
|
||||
keys: ['name', 'display_name'],
|
||||
keys: ['name', 'display_name', 'search_aliases'],
|
||||
includeScore: true,
|
||||
threshold: 0.3,
|
||||
shouldSort: false,
|
||||
|
||||
Reference in New Issue
Block a user