Line data Source code
1 : import type {
2 : NodeExecutionOutput,
3 : ResultItem
4 : } from '@comfyorg/api-client/executionTypes'
5 :
6 : type InputPreviewOutput = Pick<NodeExecutionOutput, 'images'> & {
7 : images: ResultItem[]
8 : }
9 :
10 85 : export function isInputPreviewOutput(
11 : output: Pick<NodeExecutionOutput, 'images'> | undefined
12 : ): output is InputPreviewOutput {
13 85 : const images = output?.images
14 85 : return (
15 : Array.isArray(images) &&
16 : images.length > 0 &&
17 : images.every((image) => image.type === 'input')
18 : )
19 : }
|