Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
9e4a75b1
Unverified
Commit
9e4a75b1
authored
Sep 02, 2025
by
Ziheng Zhang
Committed by
GitHub
Sep 01, 2025
Browse files
[docs] Fix VAE scale factor calculation in distributed inference docs (#12259)
docs: Fix VAE scale factor calculation
parent
0ff1aa91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
docs/source/en/training/distributed_inference.md
docs/source/en/training/distributed_inference.md
+1
-1
docs/source/zh/training/distributed_inference.md
docs/source/zh/training/distributed_inference.md
+1
-1
No files found.
docs/source/en/training/distributed_inference.md
View file @
9e4a75b1
...
@@ -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
():
...
...
docs/source/zh/training/distributed_inference.md
View file @
9e4a75b1
...
@@ -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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment