Support batch image upload (#2597)

This commit is contained in:
bymyself
2025-02-17 11:56:21 -07:00
committed by GitHub
parent 79452ce267
commit 141e64354c
11 changed files with 195 additions and 104 deletions

View File

@@ -1,4 +1,5 @@
import type { IWidget, LGraphNode } from '@comfyorg/litegraph'
import type { IComboWidget } from '@comfyorg/litegraph/dist/types/widgets'
export function isImageNode(node: LGraphNode) {
return (
@@ -8,3 +9,11 @@ export function isImageNode(node: LGraphNode) {
node.widgets.findIndex((obj: IWidget) => obj.name === 'image') >= 0)
)
}
export function addToComboValues(widget: IComboWidget, value: string) {
if (!widget.options) widget.options = { values: [] }
if (!widget.options.values) widget.options.values = []
if (!widget.options.values.includes(value)) {
widget.options.values.push(value)
}
}