mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 00:50:01 +00:00
Support search filtering to dynamic input types (#9388)
Previously, MatchType and Autogrow inputs would not be considered would filtering searchbox entires. For example, "Batch Images" would not show as a suggestion would dragging a noodle from a "Load Image" node. This is resolved by adding a step during nodeDef registration to precalculate a list of all input types. This may have performance implications. - Search filtering should be more performant - Initial node registration will be slower - There's additional memory cost to store this information on every node. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9388-Support-search-filtering-to-dynamic-input-types-3196d73d365081d9939eff5e167a7e83) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -6,6 +6,7 @@ import { computed, ref, watchEffect } from 'vue'
|
||||
import { t } from '@/i18n'
|
||||
import { isPromotedWidgetView } from '@/core/graph/subgraph/promotedWidgetTypes'
|
||||
import { resolvePromotedWidgetSource } from '@/core/graph/subgraph/resolvePromotedWidgetSource'
|
||||
import { resolveInputType } from '@/core/graph/widgets/dynamicTypes'
|
||||
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||
import { transformNodeDefV1ToV2 } from '@/schemas/nodeDef/migration'
|
||||
@@ -98,6 +99,7 @@ export class ComfyNodeDefImpl
|
||||
|
||||
// ComfyNodeDefImpl fields
|
||||
readonly nodeSource: NodeSource
|
||||
readonly inputTypes: string[]
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -179,6 +181,9 @@ export class ComfyNodeDefImpl
|
||||
|
||||
// Initialize node source
|
||||
this.nodeSource = getNodeSource(obj.python_module, this.essentials_category)
|
||||
this.inputTypes = _.uniq(
|
||||
Object.values(this.inputs).flatMap(resolveInputType)
|
||||
)
|
||||
}
|
||||
|
||||
get nodePath(): string {
|
||||
|
||||
Reference in New Issue
Block a user