Line data Source code
1 : import type { ComfyExtension } from '@/types/comfy'
2 :
3 2355 : const HIDDEN_WIDGETS = new Set(['width', 'height', 'bg_color'])
4 :
5 2355 : export const painterExtension: ComfyExtension = {
6 : name: 'Comfy.Painter',
7 :
8 : nodeCreated(node) {
9 23115 : if (node.constructor.comfyClass !== 'Painter') return
10 :
11 32 : const [oldWidth, oldHeight] = node.size
12 32 : node.setSize([Math.max(oldWidth, 450), Math.max(oldHeight, 550)])
13 :
14 32 : node.hideOutputImages = true
15 :
16 23115 : for (const widget of node.widgets ?? []) {
17 128 : if (HIDDEN_WIDGETS.has(widget.name)) {
18 96 : widget.hidden = true
19 : }
20 : }
21 : }
22 : }
|