mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Add system node to serach box db (#128)
This commit is contained in:
10
src/App.vue
10
src/App.vue
@@ -10,7 +10,10 @@ import { onMounted, onUnmounted, provide, ref } from "vue";
|
|||||||
import NodeSearchboxPopover from "@/components/NodeSearchBoxPopover.vue";
|
import NodeSearchboxPopover from "@/components/NodeSearchBoxPopover.vue";
|
||||||
import ProgressSpinner from "primevue/progressspinner";
|
import ProgressSpinner from "primevue/progressspinner";
|
||||||
import { api } from "@/scripts/api";
|
import { api } from "@/scripts/api";
|
||||||
import { NodeSearchService } from "./services/nodeSearchService";
|
import {
|
||||||
|
NodeSearchService,
|
||||||
|
SYSTEM_NODE_DEFS,
|
||||||
|
} from "./services/nodeSearchService";
|
||||||
import { ColorPaletteLoadedEvent } from "./types/colorPalette";
|
import { ColorPaletteLoadedEvent } from "./types/colorPalette";
|
||||||
import { LiteGraphNodeSearchSettingEvent } from "./scripts/ui";
|
import { LiteGraphNodeSearchSettingEvent } from "./scripts/ui";
|
||||||
|
|
||||||
@@ -35,7 +38,10 @@ const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => {
|
|||||||
|
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const nodeDefs = Object.values(await api.getNodeDefs());
|
const nodeDefs = Object.values(await api.getNodeDefs());
|
||||||
nodeSearchService.value = new NodeSearchService(nodeDefs);
|
nodeSearchService.value = new NodeSearchService([
|
||||||
|
...nodeDefs,
|
||||||
|
...SYSTEM_NODE_DEFS,
|
||||||
|
]);
|
||||||
|
|
||||||
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
|
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
|
|||||||
@@ -3,6 +3,42 @@ import { getNodeSource } from "@/types/nodeSource";
|
|||||||
import Fuse, { IFuseOptions, FuseSearchOptions } from "fuse.js";
|
import Fuse, { IFuseOptions, FuseSearchOptions } from "fuse.js";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
|
export const SYSTEM_NODE_DEFS: ComfyNodeDef[] = [
|
||||||
|
{
|
||||||
|
name: "PrimitiveNode",
|
||||||
|
display_name: "Primitive",
|
||||||
|
category: "utils",
|
||||||
|
input: { required: {}, optional: {} },
|
||||||
|
output: ["*"],
|
||||||
|
output_name: ["connect to widget input"],
|
||||||
|
output_is_list: [false],
|
||||||
|
python_module: "nodes",
|
||||||
|
description: "Primitive values like numbers, strings, and booleans.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Reroute",
|
||||||
|
display_name: "Reroute",
|
||||||
|
category: "utils",
|
||||||
|
input: { required: { "": ["*"] }, optional: {} },
|
||||||
|
output: ["*"],
|
||||||
|
output_name: [""],
|
||||||
|
output_is_list: [false],
|
||||||
|
python_module: "nodes",
|
||||||
|
description: "Reroute the connection to another node.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Note",
|
||||||
|
display_name: "Note",
|
||||||
|
category: "utils",
|
||||||
|
input: { required: {}, optional: {} },
|
||||||
|
output: [],
|
||||||
|
output_name: [],
|
||||||
|
output_is_list: [],
|
||||||
|
python_module: "nodes",
|
||||||
|
description: "Node that add notes to your project",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
export class FuseSearch<T> {
|
export class FuseSearch<T> {
|
||||||
private fuse: Fuse<T>;
|
private fuse: Fuse<T>;
|
||||||
public readonly data: T[];
|
public readonly data: T[];
|
||||||
|
|||||||
Reference in New Issue
Block a user