Skip to content

Commit 93a0c10

Browse files
authored
Add system node to serach box db (#128)
1 parent 5fac7c9 commit 93a0c10

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

src/App.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import { onMounted, onUnmounted, provide, ref } from "vue";
1010
import NodeSearchboxPopover from "@/components/NodeSearchBoxPopover.vue";
1111
import ProgressSpinner from "primevue/progressspinner";
1212
import { api } from "@/scripts/api";
13-
import { NodeSearchService } from "./services/nodeSearchService";
13+
import {
14+
NodeSearchService,
15+
SYSTEM_NODE_DEFS,
16+
} from "./services/nodeSearchService";
1417
import { ColorPaletteLoadedEvent } from "./types/colorPalette";
1518
import { LiteGraphNodeSearchSettingEvent } from "./scripts/ui";
1619
@@ -35,7 +38,10 @@ const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => {
3538
3639
const init = async () => {
3740
const nodeDefs = Object.values(await api.getNodeDefs());
38-
nodeSearchService.value = new NodeSearchService(nodeDefs);
41+
nodeSearchService.value = new NodeSearchService([
42+
...nodeDefs,
43+
...SYSTEM_NODE_DEFS,
44+
]);
3945
4046
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
4147
document.addEventListener(

src/services/nodeSearchService.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,42 @@ import { getNodeSource } from "@/types/nodeSource";
33
import Fuse, { IFuseOptions, FuseSearchOptions } from "fuse.js";
44
import _ from "lodash";
55

6+
export const SYSTEM_NODE_DEFS: ComfyNodeDef[] = [
7+
{
8+
name: "PrimitiveNode",
9+
display_name: "Primitive",
10+
category: "utils",
11+
input: { required: {}, optional: {} },
12+
output: ["*"],
13+
output_name: ["connect to widget input"],
14+
output_is_list: [false],
15+
python_module: "nodes",
16+
description: "Primitive values like numbers, strings, and booleans.",
17+
},
18+
{
19+
name: "Reroute",
20+
display_name: "Reroute",
21+
category: "utils",
22+
input: { required: { "": ["*"] }, optional: {} },
23+
output: ["*"],
24+
output_name: [""],
25+
output_is_list: [false],
26+
python_module: "nodes",
27+
description: "Reroute the connection to another node.",
28+
},
29+
{
30+
name: "Note",
31+
display_name: "Note",
32+
category: "utils",
33+
input: { required: {}, optional: {} },
34+
output: [],
35+
output_name: [],
36+
output_is_list: [],
37+
python_module: "nodes",
38+
description: "Node that add notes to your project",
39+
},
40+
];
41+
642
export class FuseSearch<T> {
743
private fuse: Fuse<T>;
844
public readonly data: T[];

0 commit comments

Comments
 (0)