Unverified Commit 9e4a75b1 authored by Ziheng Zhang's avatar Ziheng Zhang Committed by GitHub
Browse files

[docs] Fix VAE scale factor calculation in distributed inference docs (#12259)

docs: Fix VAE scale factor calculation
parent 0ff1aa91
...@@ -223,7 +223,7 @@ from diffusers.image_processor import VaeImageProcessor ...@@ -223,7 +223,7 @@ from diffusers.image_processor import VaeImageProcessor
import torch import torch
vae = AutoencoderKL.from_pretrained(ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16).to("cuda") vae = AutoencoderKL.from_pretrained(ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16).to("cuda")
vae_scale_factor = 2 ** (len(vae.config.block_out_channels)) vae_scale_factor = 2 ** (len(vae.config.block_out_channels) - 1)
image_processor = VaeImageProcessor(vae_scale_factor=vae_scale_factor) image_processor = VaeImageProcessor(vae_scale_factor=vae_scale_factor)
with torch.no_grad(): with torch.no_grad():
......
...@@ -223,7 +223,7 @@ from diffusers.image_processor import VaeImageProcessor ...@@ -223,7 +223,7 @@ from diffusers.image_processor import VaeImageProcessor
import torch import torch
vae = AutoencoderKL.from_pretrained(ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16).to("cuda") vae = AutoencoderKL.from_pretrained(ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16).to("cuda")
vae_scale_factor = 2 ** (len(vae.config.block_out_channels)) vae_scale_factor = 2 ** (len(vae.config.block_out_channels) - 1)
image_processor = VaeImageProcessor(vae_scale_factor=vae_scale_factor) image_processor = VaeImageProcessor(vae_scale_factor=vae_scale_factor)
with torch.no_grad(): with torch.no_grad():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment