opensi·si

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_std instead of a scaling_factor.
  • Pixels are ImageNet-normalized RGB over [0, 1]: encode expects (pixel - imagenet_mean) / imagenet_std and decode returns 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.