[TS] Widget typing (#3804)

This commit is contained in:
filtered
2025-05-08 04:38:17 +10:00
committed by GitHub
parent bb1ac32ccd
commit b9d9ce78f9
12 changed files with 51 additions and 65 deletions

View File

@@ -75,7 +75,7 @@
</template>
<script setup lang="ts">
import { IWidget, LGraphNode } from '@comfyorg/litegraph'
import { LGraphNode } from '@comfyorg/litegraph'
import { Tooltip } from 'primevue'
import Button from 'primevue/button'
@@ -101,13 +101,13 @@ const emit = defineEmits<{
const resizeNodeMatchOutput = () => {
console.log('resizeNodeMatchOutput')
const outputWidth = node.widgets?.find((w: IWidget) => w.name === 'width')
const outputHeight = node.widgets?.find((w: IWidget) => w.name === 'height')
const outputWidth = node.widgets?.find((w) => w.name === 'width')
const outputHeight = node.widgets?.find((w) => w.name === 'height')
if (outputWidth && outputHeight && outputHeight.value && outputWidth.value) {
const [oldWidth, oldHeight] = node.size
const scene = node.widgets?.find((w: IWidget) => w.name === 'image')
const scene = node.widgets?.find((w) => w.name === 'image')
const sceneHeight = scene?.computedHeight