1
1
import type { RootState } from 'app/store/store' ;
2
- import type { CanvasEntityAdapterInpaintMask } from 'features/controlLayers/konva/CanvasEntity/CanvasEntityAdapterInpaintMask' ;
3
2
import type { CanvasManager } from 'features/controlLayers/konva/CanvasManager' ;
4
3
import { getPrefixedId } from 'features/controlLayers/konva/util' ;
5
4
import { selectCanvasSettingsSlice } from 'features/controlLayers/store/canvasSettingsSlice' ;
@@ -16,7 +15,7 @@ import type {
16
15
VaeSourceNodes ,
17
16
} from 'features/nodes/util/graph/types' ;
18
17
import { isEqual } from 'lodash-es' ;
19
- import type { Invocation } from 'services/api/types' ;
18
+ import type { ImageDTO , Invocation } from 'services/api/types' ;
20
19
21
20
type AddOutpaintArg = {
22
21
state : RootState ;
@@ -71,23 +70,17 @@ export const addOutpaint = async ({
71
70
const noiseMaskAdapters = inpaintMaskAdapters . filter ( ( adapter ) => adapter . state . noiseLevel !== undefined ) ;
72
71
73
72
// Create a composite noise mask if we have any adapters with noise settings
74
- let noiseMaskImage = null ;
73
+ let noiseMaskImage : ImageDTO | null = null ;
75
74
if ( noiseMaskAdapters . length > 0 ) {
76
- // Use the grayscale mask composite method with proper typing
77
- noiseMaskImage = await manager . compositor . getGrayscaleMaskCompositeImageDTO (
78
- noiseMaskAdapters as CanvasEntityAdapterInpaintMask [ ] ,
79
- rect ,
80
- 'noiseLevel' ,
81
- {
82
- is_intermediate : true ,
83
- silent : true ,
84
- }
85
- ) ;
75
+ noiseMaskImage = await manager . compositor . getGrayscaleMaskCompositeImageDTO ( noiseMaskAdapters , rect , 'noiseLevel' , {
76
+ is_intermediate : true ,
77
+ silent : true ,
78
+ } ) ;
86
79
}
87
80
88
81
// Create a composite denoise limit mask
89
82
const maskImage = await manager . compositor . getGrayscaleMaskCompositeImageDTO (
90
- inpaintMaskAdapters as CanvasEntityAdapterInpaintMask [ ] , // denoise limit defaults to 1 for masks that don't have it
83
+ inpaintMaskAdapters , // denoise limit defaults to 1 for masks that don't have it
91
84
rect ,
92
85
'denoiseLimit' ,
93
86
{
0 commit comments