File size: 2,348 Bytes
0b26330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e079d1
0b26330
 
 
 
 
 
 
 
 
 
 
0db3e60
 
 
 
 
0b26330
 
0db3e60
 
 
0b26330
0db3e60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
```CODE: 
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image, export_to_video

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("Lightricks/LTX-2", dtype=torch.bfloat16, device_map="cuda")
pipe.to("cuda")

prompt = "A man with short gray hair plays a red electric guitar."
image = load_image(
    "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
)

output = pipe(image=image, prompt=prompt).frames[0]
export_to_video(output, "output.mp4")
```

ERROR: 
Traceback (most recent call last):
  File "/tmp/Lightricks_LTX-2_0ich7gg.py", line 28, in <module>
    pipe = DiffusionPipeline.from_pretrained("Lightricks/LTX-2", dtype=torch.bfloat16, device_map="cuda")
  File "/tmp/.cache/uv/environments-v2/e8822e4ae31fc8f1/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/tmp/.cache/uv/environments-v2/e8822e4ae31fc8f1/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 829, in from_pretrained
    cached_folder = cls.download(
        pretrained_model_name_or_path,
    ...<14 lines>...
        **kwargs,
    )
  File "/tmp/.cache/uv/environments-v2/e8822e4ae31fc8f1/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/tmp/.cache/uv/environments-v2/e8822e4ae31fc8f1/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 1637, in download
    custom_components, folder_names = _get_custom_components_and_folders(
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        pretrained_model_name, config_dict, filenames, variant
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/tmp/.cache/uv/environments-v2/e8822e4ae31fc8f1/lib/python3.13/site-packages/diffusers/pipelines/pipeline_loading_utils.py", line 1071, in _get_custom_components_and_folders
    raise ValueError(
        f"{candidate_file} as defined in `model_index.json` does not exist in {pretrained_model_name} and is not a module in 'diffusers/pipelines'."
    )
ValueError: connectors/ltx2.py as defined in `model_index.json` does not exist in Lightricks/LTX-2 and is not a module in 'diffusers/pipelines'.