> For the complete documentation index, see [llms.txt](https://boinc-ai.gitbook.io/diffusers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boinc-ai.gitbook.io/diffusers/api/main-classes/outputs.md).

# Outputs

## Outputs

All models outputs are subclasses of [BaseOutput](https://huggingface.co/docs/diffusers/v0.21.0/en/api/outputs#diffusers.utils.BaseOutput), data structures containing all the information returned by the model. The outputs can also be used as tuples or dictionaries.

For example:

Copied

```
from diffusers import DDIMPipeline

pipeline = DDIMPipeline.from_pretrained("google/ddpm-cifar10-32")
outputs = pipeline()
```

The `outputs` object is a [ImagePipelineOutput](https://huggingface.co/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.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`:

Copied

```
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)`:

Copied

```
outputs[:1]
```

To check a specific pipeline or model output, refer to its corresponding API documentation.

### BaseOutput

#### class diffusers.utils.BaseOutput

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/utils/outputs.py#L40)

( )

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 `BaseOutput` directly. Use the [to\_tuple()](https://huggingface.co/docs/diffusers/v0.21.0/en/api/outputs#diffusers.utils.BaseOutput.to_tuple) method to convert it to a tuple first.

**to\_tuple**

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/utils/outputs.py#L104)

( )

Convert self to a tuple containing all the attributes/keys that are not `None`.

### ImagePipelineOutput

#### class diffusers.ImagePipelineOutput

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L112)

( images: typing.Union\[typing.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.

### FlaxImagePipelineOutput

#### class diffusers.pipelines.pipeline\_flax\_utils.FlaxImagePipelineOutput

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_flax_utils.py#L88)

( images: typing.Union\[typing.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.

**replace**

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/flax/struct.py#L111)

( \*\*updates )

“Returns a new object replacing the specified fields with new values.

### AudioPipelineOutput

#### class diffusers.AudioPipelineOutput

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L126)

( 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

#### class diffusers.ImageTextPipelineOutput

[\<source>](https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py#L55)

( images: typing.Union\[typing.List\[PIL.Image.Image], numpy.ndarray, NoneType]text: typing.Union\[typing.List\[str], typing.List\[typing.List\[str]], NoneType] )

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://boinc-ai.gitbook.io/diffusers/api/main-classes/outputs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
