Skip to content

Commit ad885b7

Browse files
committed
docs: Fix VAE scale factor calculation
1 parent ba0e732 commit ad885b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/source/en/training/distributed_inference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ from diffusers.image_processor import VaeImageProcessor
223223
import torch
224224

225225
vae = AutoencoderKL.from_pretrained(ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16).to("cuda")
226-
vae_scale_factor = 2 ** (len(vae.config.block_out_channels))
226+
vae_scale_factor = 2 ** (len(vae.config.block_out_channels) - 1)
227227
image_processor = VaeImageProcessor(vae_scale_factor=vae_scale_factor)
228228

229229
with torch.no_grad():

docs/source/zh/training/distributed_inference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ from diffusers.image_processor import VaeImageProcessor
223223
import torch
224224

225225
vae = AutoencoderKL.from_pretrained(ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16).to("cuda")
226-
vae_scale_factor = 2 ** (len(vae.config.block_out_channels))
226+
vae_scale_factor = 2 ** (len(vae.config.block_out_channels) - 1)
227227
image_processor = VaeImageProcessor(vae_scale_factor=vae_scale_factor)
228228

229229
with torch.no_grad():

0 commit comments

Comments
 (0)