mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-08 06:30:04 +00:00
## Summary The Vue node renderer checks widget.options.hidden, not widget.hidden. This was previously masked by the backend sending hidden: true via extra_dict, but is now needed as the backend switches to io.Color.Input. BE change is in https://github.com/Comfy-Org/ComfyUI/pull/12294 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9337-fix-use-widget-options-hidden-to-hide-painter-widgets-in-Vue-renderer-3176d73d3650815cad4beb8f9f35f7e6) by [Unito](https://www.unito.io)
23 lines
580 B
TypeScript
23 lines
580 B
TypeScript
import { useExtensionService } from '@/services/extensionService'
|
|
|
|
const HIDDEN_WIDGETS = new Set(['width', 'height', 'bg_color'])
|
|
|
|
useExtensionService().registerExtension({
|
|
name: 'Comfy.Painter',
|
|
|
|
nodeCreated(node) {
|
|
if (node.constructor.comfyClass !== 'Painter') return
|
|
|
|
const [oldWidth, oldHeight] = node.size
|
|
node.setSize([Math.max(oldWidth, 450), Math.max(oldHeight, 550)])
|
|
|
|
node.hideOutputImages = true
|
|
|
|
for (const widget of node.widgets ?? []) {
|
|
if (HIDDEN_WIDGETS.has(widget.name)) {
|
|
widget.options.hidden = true
|
|
}
|
|
}
|
|
}
|
|
})
|