Line data Source code
1 : import type { ComfyExtension } from '@/types/comfy'
2 :
3 2355 : const INTERNAL_WIDGETS = new Set(['last_incoming'])
4 :
5 2355 : export const createBoundingBoxesExtension: ComfyExtension = {
6 : name: 'Comfy.CreateBoundingBoxes',
7 :
8 : nodeCreated(node) {
9 23115 : if (node.constructor.comfyClass !== 'CreateBoundingBoxes') return
10 :
11 0 : const [oldWidth, oldHeight] = node.size
12 0 : node.setSize([Math.max(oldWidth, 420), Math.max(oldHeight, 560)])
13 :
14 23115 : for (const widget of node.widgets ?? []) {
15 0 : if (INTERNAL_WIDGETS.has(widget.name)) widget.hidden = true
16 : }
17 : }
18 : }
|