pipeline_output.py 1.08 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
from dataclasses import dataclass

import torch

from diffusers.utils import BaseOutput


@dataclass
class KandinskyPipelineOutput(BaseOutput):
    r"""
11
    Output class for kandinsky video pipelines.
12
13
14
15
16
17
18
19
20

    Args:
        frames (`torch.Tensor`, `np.ndarray`, or List[List[PIL.Image.Image]]):
            List of video outputs - It can be a nested list of length `batch_size,` with each sub-list containing
            denoised PIL image sequences of length `num_frames.` It can also be a NumPy array or Torch tensor of shape
            `(batch_size, num_frames, channels, height, width)`.
    """

    frames: torch.Tensor
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35


@dataclass
class KandinskyImagePipelineOutput(BaseOutput):
    r"""
    Output class for kandinsky image pipelines.

    Args:
        image (`torch.Tensor`, `np.ndarray`, or List[PIL.Image.Image]):
            List of image outputs - It can be a nested list of length `batch_size,` with each sub-list containing
            denoised PIL image. It can also be a NumPy array or Torch tensor of shape `(batch_size, channels, height,
            width)`.
    """

    image: torch.Tensor