node model metadata edit popover

This commit is contained in:
bymyself
2025-02-27 17:41:36 -07:00
parent cb4a5b88fc
commit 590280dd92
7 changed files with 340 additions and 9 deletions

View File

@@ -47,6 +47,26 @@ export const isLGraphGroup = (item: unknown): item is LGraphGroup => {
return item instanceof LGraphGroup
}
const modelOutputTypes = new Set([
'MODEL',
'CLIP',
'VAE',
'CONTROL_NET',
'UPSCALE_MODEL',
'CLIP_VISION',
'STYLE_MODEL',
'GLIGEN',
'HOOKS',
'UPSCALE_MODEL',
'PHOTOMAKER',
'SAM_MODEL'
])
export const isModelNode = (node: LGraphNode): boolean => {
if (!node?.outputs?.length) return false
return node.outputs.some((output) => modelOutputTypes.has(`${output.type}`))
}
/**
* Get the color option of all canvas items if they are all the same.
* @param items - The items to get the color option of.