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
6a970a45
Unverified
Commit
6a970a45
authored
Dec 23, 2024
by
Sayak Paul
Committed by
GitHub
Dec 23, 2024
Browse files
[docs] fix: torchao example. (#10278)
fix: torchao example.
parent
ffc0eaab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
docs/source/en/quantization/torchao.md
docs/source/en/quantization/torchao.md
+4
-2
No files found.
docs/source/en/quantization/torchao.md
View file @
6a970a45
...
@@ -27,7 +27,7 @@ The example below only quantizes the weights to int8.
...
@@ -27,7 +27,7 @@ The example below only quantizes the weights to int8.
```
python
```
python
from
diffusers
import
FluxPipeline
,
FluxTransformer2DModel
,
TorchAoConfig
from
diffusers
import
FluxPipeline
,
FluxTransformer2DModel
,
TorchAoConfig
model_id
=
"black-forest-labs/F
lux
.1-
D
ev"
model_id
=
"black-forest-labs/F
LUX
.1-
d
ev"
dtype
=
torch
.
bfloat16
dtype
=
torch
.
bfloat16
quantization_config
=
TorchAoConfig
(
"int8wo"
)
quantization_config
=
TorchAoConfig
(
"int8wo"
)
...
@@ -45,7 +45,9 @@ pipe = FluxPipeline.from_pretrained(
...
@@ -45,7 +45,9 @@ pipe = FluxPipeline.from_pretrained(
pipe
.
to
(
"cuda"
)
pipe
.
to
(
"cuda"
)
prompt
=
"A cat holding a sign that says hello world"
prompt
=
"A cat holding a sign that says hello world"
image
=
pipe
(
prompt
,
num_inference_steps
=
28
,
guidance_scale
=
0.0
).
images
[
0
]
image
=
pipe
(
prompt
,
num_inference_steps
=
50
,
guidance_scale
=
4.5
,
max_sequence_length
=
512
).
images
[
0
]
image
.
save
(
"output.png"
)
image
.
save
(
"output.png"
)
```
```
...
...
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