Update widget types to match Litegraph changes (#3808)

This commit is contained in:
filtered
2025-05-08 06:56:53 +10:00
committed by GitHub
parent 6fdef0308b
commit 3aea2c120a
11 changed files with 45 additions and 44 deletions

View File

@@ -1,4 +1,4 @@
import type { IWidget } from '@comfyorg/litegraph'
import type { IBaseWidget } from '@comfyorg/litegraph/dist/types/widgets'
import Load3d from '@/extensions/core/load3d/Load3d'
import Load3dUtils from '@/extensions/core/load3d/Load3dUtils'
@@ -15,17 +15,20 @@ class Load3DConfiguration {
configure(
loadFolder: 'input' | 'output',
modelWidget: IWidget,
modelWidget: IBaseWidget,
cameraState?: any,
width: IWidget | null = null,
height: IWidget | null = null
width: IBaseWidget | null = null,
height: IBaseWidget | null = null
) {
this.setupModelHandling(modelWidget, loadFolder, cameraState)
this.setupTargetSize(width, height)
this.setupDefaultProperties()
}
private setupTargetSize(width: IWidget | null, height: IWidget | null) {
private setupTargetSize(
width: IBaseWidget | null,
height: IBaseWidget | null
) {
if (width && height) {
this.load3d.setTargetSize(width.value as number, height.value as number)
@@ -51,7 +54,7 @@ class Load3DConfiguration {
}
private setupModelHandling(
modelWidget: IWidget,
modelWidget: IBaseWidget,
loadFolder: 'input' | 'output',
cameraState?: any
) {