image_processor.md 1.74 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
<!--Copyright 2023 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

Steven Liu's avatar
Steven Liu committed
13
# VAE Image Processor
estelleafl's avatar
estelleafl committed
14

Steven Liu's avatar
Steven Liu committed
15
The [`VaeImageProcessor`] provides a unified API for [`StableDiffusionPipeline`]'s to prepare image inputs for VAE encoding and post-processing outputs once they're decoded. This includes transformations such as resizing, normalization, and conversion between PIL Image, PyTorch, and NumPy arrays. 
estelleafl's avatar
estelleafl committed
16

Steven Liu's avatar
Steven Liu committed
17
All pipelines with [`VaeImageProcessor`] accepts PIL Image, PyTorch tensor, or NumPy arrays as image inputs and returns outputs based on the `output_type` argument by the user. You can pass encoded image latents directly to the pipeline and return latents from the pipeline as a specific output with the `output_type` argument (for example `output_type="pt"`). This allows you to take the generated latents from one pipeline and pass it to another pipeline as input without leaving the latent space. It also makes it much easier to use multiple pipelines together by passing PyTorch tensors directly between different pipelines. 
estelleafl's avatar
estelleafl committed
18

19
20
## VaeImageProcessor

estelleafl's avatar
estelleafl committed
21
22
23
24
[[autodoc]] image_processor.VaeImageProcessor

## VaeImageProcessorLDM3D

Steven Liu's avatar
Steven Liu committed
25
26
The [`VaeImageProcessorLDM3D`] accepts RGB and depth inputs and returns RGB and depth outputs.

estelleafl's avatar
estelleafl committed
27
[[autodoc]] image_processor.VaeImageProcessorLDM3D