The image VAE of P-H3-Image by Pruna AI. It uses the encoder and latent space of MiniMax-H3's video VAE, with a ViT decoder that decodes a single latent frame into an image.
AutoencoderKLPH3Image
The image VAE of P-H3-Image by Pruna AI. It uses the encoder and latent space of MiniMax-H3's video VAE, with a ViT decoder that decodes a single latent frame into an image.
It follows the conventions of AutoencoderKLMiniMaxH3:
- Images are passed as single-frame videos,
(batch_size, channels, 1, height, width), with 16x spatial compression. - Latents are normalized per channel with
latents_mean/latents_stdinstead of ascaling_factor. - Pixels are ImageNet-normalized RGB over
[0, 1]:encodeexpects(pixel - imagenet_mean) / imagenet_stdanddecodereturns that space. - Spatial tiling is on by default, with 256 pixel tiles and at least 64 pixels of overlap.
import torch
from diffusers import AutoencoderKLPH3Image
vae = AutoencoderKLPH3Image.from_pretrained("PrunaAI/P-H3-Image", subfolder="vae", dtype=torch.bfloat16).to(
"cuda"
) # or "mps", "xpu", "cpu"
The encoder and the decoder's output projection stay in float32 whatever dtype the model is loaded in.
AutoencoderKLPH3Image
[[autodoc]] AutoencoderKLPH3Image - encode - decode - all
Source and license
Source: Diffusers documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.