Skip to content

Commit 606e6b2

Browse files
committed
update
1 parent 57c41df commit 606e6b2

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@
4444
Examples:
4545
```py
4646
>>> import torch
47-
>>> from diffusers import LTXPipeline
48-
>>> from diffusers.utils import export_to_video
47+
>>> from diffusers import LTXImageToVideoPipeline
48+
>>> from diffusers.utils import export_to_video, load_image
4949
50-
>>> pipe = LTXPipeline.from_pretrained("a-r-r-o-w/LTX-Video-diffusers", torch_dtype=torch.bfloat16)
50+
>>> pipe = LTXImageToVideoPipeline.from_pretrained("a-r-r-o-w/LTX-Video-diffusers", torch_dtype=torch.bfloat16)
5151
>>> pipe.to("cuda")
5252
53-
>>> prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage"
53+
>>> image = load_image(
54+
... "https://huggingface.co/datasets/a-r-r-o-w/tiny-meme-dataset-captioned/resolve/main/images/8.png"
55+
... )
56+
>>> prompt = "A young girl stands calmly in the foreground, looking directly at the camera, as a house fire rages in the background. Flames engulf the structure, with smoke billowing into the air. Firefighters in protective gear rush to the scene, a fire truck labeled '38' visible behind them. The girl's neutral expression contrasts sharply with the chaos of the fire, creating a poignant and emotionally charged scene."
5457
>>> negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
5558
5659
>>> video = pipe(
60+
... image=image,
5761
... prompt=prompt,
5862
... negative_prompt=negative_prompt,
5963
... width=704,

tests/models/transformers/test_models_transformer_ltx.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
enable_full_determinism()
2727

2828

29-
class MochiTransformerTests(ModelTesterMixin, unittest.TestCase):
29+
class LTXTransformerTests(ModelTesterMixin, unittest.TestCase):
3030
model_class = LTXTransformer3DModel
3131
main_input_name = "hidden_states"
3232
uses_custom_attn_processor = True
@@ -41,7 +41,7 @@ def dummy_input(self):
4141
embedding_dim = 16
4242
sequence_length = 16
4343

44-
hidden_states = torch.randn((batch_size, num_channels, num_frames, height, width)).to(torch_device)
44+
hidden_states = torch.randn((batch_size, num_frames * height * width, num_channels)).to(torch_device)
4545
encoder_hidden_states = torch.randn((batch_size, sequence_length, embedding_dim)).to(torch_device)
4646
encoder_attention_mask = torch.ones((batch_size, sequence_length)).bool().to(torch_device)
4747
timestep = torch.randint(0, 1000, size=(batch_size,)).to(torch_device)
@@ -51,15 +51,18 @@ def dummy_input(self):
5151
"encoder_hidden_states": encoder_hidden_states,
5252
"timestep": timestep,
5353
"encoder_attention_mask": encoder_attention_mask,
54+
"num_frames": num_frames,
55+
"height": height,
56+
"width": width,
5457
}
5558

5659
@property
5760
def input_shape(self):
58-
return (4, 2, 16, 16)
61+
return (512, 4)
5962

6063
@property
6164
def output_shape(self):
62-
return (4, 2, 16, 16)
65+
return (512, 4)
6366

6467
def prepare_init_args_and_inputs_for_common(self):
6568
init_dict = {

0 commit comments

Comments
 (0)