Skip to content

Commit bea8138

Browse files
christian-byrneampcode-com
authored andcommitted
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, Comfy-Org/ComfyUI#12035 - **Adding aliases**: - Comfy-Org/ComfyUI#12016 - Comfy-Org/ComfyUI#12017 - Comfy-Org/ComfyUI#12018 - Comfy-Org/ComfyUI#12019 - **Docs:** Comfy-Org/docs#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>
1 parent dcaca49 commit bea8138

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/schemas/nodeDefSchema.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ export const zComfyNodeDef = z.object({
269269
* Keys are 'required', 'optional', etc., values are arrays of input names.
270270
*/
271271
input_order: z.record(z.array(z.string())).optional(),
272+
/**
273+
* Alternative names for search. Useful for synonyms, abbreviations,
274+
* or old names after renaming a node.
275+
*/
276+
search_aliases: z.array(z.string()).optional(),
272277
/**
273278
* Price badge definition for API nodes.
274279
* Contains a JSONata expression to calculate pricing based on widget values

src/services/nodeSearchService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class NodeSearchService {
1414
constructor(data: ComfyNodeDefImpl[]) {
1515
this.nodeFuseSearch = new FuseSearch(data, {
1616
fuseOptions: {
17-
keys: ['name', 'display_name'],
17+
keys: ['name', 'display_name', 'search_aliases'],
1818
includeScore: true,
1919
threshold: 0.3,
2020
shouldSort: false,

0 commit comments

Comments
 (0)