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
e68092a4
Unverified
Commit
e68092a4
authored
Dec 16, 2024
by
Sayak Paul
Committed by
GitHub
Dec 16, 2024
Browse files
[docs] minor stuff to ltx video docs. (#10229)
minor stuff to ltx video docs.
parent
3bf5400a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
docs/source/en/api/pipelines/ltx_video.md
docs/source/en/api/pipelines/ltx_video.md
+18
-6
No files found.
docs/source/en/api/pipelines/ltx_video.md
View file @
e68092a4
...
@@ -31,14 +31,18 @@ import torch
...
@@ -31,14 +31,18 @@ import torch
from
diffusers
import
AutoencoderKLLTXVideo
,
LTXImageToVideoPipeline
,
LTXVideoTransformer3DModel
from
diffusers
import
AutoencoderKLLTXVideo
,
LTXImageToVideoPipeline
,
LTXVideoTransformer3DModel
single_file_url
=
"https://huggingface.co/Lightricks/LTX-Video/ltx-video-2b-v0.9.safetensors"
single_file_url
=
"https://huggingface.co/Lightricks/LTX-Video/ltx-video-2b-v0.9.safetensors"
transformer
=
LTXVideoTransformer3DModel
.
from_single_file
(
single_file_url
,
torch_dtype
=
torch
.
bfloat16
)
transformer
=
LTXVideoTransformer3DModel
.
from_single_file
(
single_file_url
,
torch_dtype
=
torch
.
bfloat16
)
vae
=
AutoencoderKLLTXVideo
.
from_single_file
(
single_file_url
,
torch_dtype
=
torch
.
bfloat16
)
vae
=
AutoencoderKLLTXVideo
.
from_single_file
(
single_file_url
,
torch_dtype
=
torch
.
bfloat16
)
pipe
=
LTXImageToVideoPipeline
.
from_pretrained
(
"Lightricks/LTX-Video"
,
transformer
=
transformer
,
vae
=
vae
,
torch_dtype
=
torch
.
bfloat16
)
pipe
=
LTXImageToVideoPipeline
.
from_pretrained
(
"Lightricks/LTX-Video"
,
transformer
=
transformer
,
vae
=
vae
,
torch_dtype
=
torch
.
bfloat16
)
# ... inference code ...
# ... inference code ...
```
```
Alternatively, the pipeline can be used to load the weights with [~FromSingleFileMixin.from_single_file
`].
Alternatively, the pipeline can be used to load the weights with [
`
~FromSingleFileMixin.from_single_file`
].
```
python
```
python
import
torch
import
torch
...
@@ -46,11 +50,19 @@ from diffusers import LTXImageToVideoPipeline
...
@@ -46,11 +50,19 @@ from diffusers import LTXImageToVideoPipeline
from
transformers
import
T5EncoderModel
,
T5Tokenizer
from
transformers
import
T5EncoderModel
,
T5Tokenizer
single_file_url
=
"https://huggingface.co/Lightricks/LTX-Video/ltx-video-2b-v0.9.safetensors"
single_file_url
=
"https://huggingface.co/Lightricks/LTX-Video/ltx-video-2b-v0.9.safetensors"
text_encoder = T5EncoderModel.from_pretrained("Lightricks/LTX-Video", subfolder="text_encoder", torch_dtype=torch.bfloat16)
text_encoder
=
T5EncoderModel
.
from_pretrained
(
tokenizer = T5Tokenizer.from_pretrained("Lightricks/LTX-Video", subfolder="tokenizer", torch_dtype=torch.bfloat16)
"Lightricks/LTX-Video"
,
subfolder
=
"text_encoder"
,
torch_dtype
=
torch
.
bfloat16
pipe = LTXImageToVideoPipeline.from_single_file(single_file_url, text_encoder=text_encoder, tokenizer=tokenizer, torch_dtype=torch.bfloat16)
)
tokenizer
=
T5Tokenizer
.
from_pretrained
(
"Lightricks/LTX-Video"
,
subfolder
=
"tokenizer"
,
torch_dtype
=
torch
.
bfloat16
)
pipe
=
LTXImageToVideoPipeline
.
from_single_file
(
single_file_url
,
text_encoder
=
text_encoder
,
tokenizer
=
tokenizer
,
torch_dtype
=
torch
.
bfloat16
)
```
```
Refer to
[
this section
](
https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogvideox#memory-optimization
)
to learn more about optimizing memory consumption.
## LTXPipeline
## LTXPipeline
[[autodoc]] LTXPipeline
[[autodoc]] LTXPipeline
...
...
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