Buckets:
Outputs
All model outputs are subclasses of BaseOutput, data structures containing all the information returned by the model. The outputs can also be used as tuples or dictionaries.
For example:
from diffusers import DDIMPipeline
pipeline = DDIMPipeline.from_pretrained("google/ddpm-cifar10-32")
outputs = pipeline()
The outputs object is a ImagePipelineOutput which means it has an image attribute.
You can access each attribute as you normally would or with a keyword lookup, and if that attribute is not returned by the model, you will get None:
outputs.images
outputs["images"]
When considering the outputs object as a tuple, it only considers the attributes that don't have None values.
For instance, retrieving an image by indexing into it returns the tuple (outputs.images):
outputs[:1]
To check a specific pipeline or model output, refer to its corresponding API documentation.
BaseOutput[[diffusers.utils.BaseOutput]]
diffusers.utils.BaseOutput[[diffusers.utils.BaseOutput]]
Base class for all model outputs as dataclass. Has a __getitem__ that allows indexing by integer or slice (like a
tuple) or strings (like a dictionary) that will ignore the None attributes. Otherwise behaves like a regular
Python dictionary.
> You can't unpack a
BaseOutputdirectly. Use the to_tuple() method to convert it to a tuple > first.
to_tuple[[diffusers.utils.BaseOutput.to_tuple]]
to_tuple()
Convert self to a tuple containing all the attributes/keys that are not None.
ImagePipelineOutput[[diffusers.ImagePipelineOutput]]
diffusers.ImagePipelineOutput[[diffusers.ImagePipelineOutput]]
diffusers.ImagePipelineOutput(images: list[PIL.Image.Image] | numpy.ndarray)
Parameters:
images (List[PIL.Image.Image] or np.ndarray) : List of denoised PIL images of length batch_size or NumPy array of shape (batch_size, height, width, num_channels).
Output class for image pipelines.
AudioPipelineOutput[[diffusers.AudioPipelineOutput]]
diffusers.AudioPipelineOutput[[diffusers.AudioPipelineOutput]]
diffusers.AudioPipelineOutput(audios: ndarray)
Parameters:
audios (np.ndarray) : List of denoised audio samples of a NumPy array of shape (batch_size, num_channels, sample_rate).
Output class for audio pipelines.
ImageTextPipelineOutput[[diffusers.ImageTextPipelineOutput]]
diffusers.ImageTextPipelineOutput[[diffusers.ImageTextPipelineOutput]]
diffusers.ImageTextPipelineOutput(images: list[PIL.Image.Image] | numpy.ndarray | None, text: list[str] | list[list[str]] | None)
Parameters:
images (list[PIL.Image.Image] or np.ndarray) : list of denoised PIL images of length batch_size or NumPy array of shape (batch_size, height, width, num_channels).
text (list[str] or list[list[str]]) : list of generated text strings of length batch_size or a list of list of strings whose outer list has length batch_size.
Output class for joint image-text pipelines.
Xet Storage Details
- Size:
- 3.86 kB
- Xet hash:
- eee79a34db98befe9c5bcaf2c8bb8814d21f454217a35f3e1c76014b02f4cc5f
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.