Line data Source code
1 : import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
2 : import type { ComfyExtension } from '@/types/comfy'
3 :
4 2355 : export const imageCropExtension: ComfyExtension = {
5 : name: 'Comfy.ImageCrop',
6 :
7 : async nodeCreated(node: LGraphNode) {
8 23115 : if (node.constructor.comfyClass !== 'ImageCropV2') return
9 :
10 48 : node.hideOutputImages = true
11 48 : const [oldWidth, oldHeight] = node.size
12 48 : node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 450)])
13 : }
14 : }
|