Line data Source code
1 : import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
2 : import type { ComfyExtension } from '@/types/comfy'
3 :
4 24 : const NODE_CLASS = 'CameraAngle'
5 24 : const MIN_WIDTH = 360
6 24 : const MIN_HEIGHT = 480
7 :
8 24 : export const cameraAngleExtension: ComfyExtension = {
9 : name: 'Comfy.CameraAngle',
10 :
11 : nodeCreated(node: LGraphNode) {
12 26 : if (node.constructor.comfyClass !== NODE_CLASS) return
13 0 : const [width, height] = node.size
14 0 : node.setSize([Math.max(width, MIN_WIDTH), Math.max(height, MIN_HEIGHT)])
15 : }
16 : }
|