Only show delete in selection toolbox for reroute (#2670)

This commit is contained in:
Chenlei Hu
2025-02-21 16:03:36 -05:00
committed by GitHub
parent 6cb33d9431
commit b012f243b3
2 changed files with 12 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import type { ColorOption, IWidget } from '@comfyorg/litegraph'
import { LGraphNode, isColorable } from '@comfyorg/litegraph'
import { LGraphGroup, LGraphNode, isColorable } from '@comfyorg/litegraph'
import type { IComboWidget } from '@comfyorg/litegraph/dist/types/widgets'
import _ from 'lodash'
@@ -21,8 +21,11 @@ export function addToComboValues(widget: IComboWidget, value: string) {
}
export const isLGraphNode = (item: unknown): item is LGraphNode => {
const name = item?.constructor?.name
return name === 'ComfyNode' || name === 'LGraphNode'
return item instanceof LGraphNode
}
export const isLGraphGroup = (item: unknown): item is LGraphGroup => {
return item instanceof LGraphGroup
}
/**