Instructions to use tiny-random/ltx-2-5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use tiny-random/ltx-2-5 with Diffusers:
pip install -U diffusers transformers accelerate
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("tiny-random/ltx-2-5", 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") - Notebooks
- Google Colab
- Kaggle
File size: 2,612 Bytes
bbae6ac | 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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | {
"transformer": {
"in_channels": 128,
"out_channels": 128,
"audio_in_channels": 8,
"audio_out_channels": 8,
"num_layers": 4,
"num_attention_heads": 2,
"attention_head_dim": 32,
"audio_num_attention_heads": 2,
"audio_attention_head_dim": 32,
"cross_attention_dim": 64,
"audio_cross_attention_dim": 64,
"caption_channels": 8,
"use_prompt_embeddings": false,
"cross_attn_mod": true,
"audio_cross_attn_mod": true,
"use_prompt_adaln_single": false,
"use_keyframes_abs_pos_embedding": true
},
"connectors": {
"caption_channels": 8,
"text_proj_in_factor": 3,
"video_connector_num_attention_heads": 2,
"video_connector_attention_head_dim": 32,
"video_connector_num_layers": 2,
"video_connector_num_learnable_registers": 4,
"audio_connector_num_attention_heads": 2,
"audio_connector_attention_head_dim": 32,
"audio_connector_num_layers": 2,
"audio_connector_num_learnable_registers": 4,
"video_hidden_dim": 64,
"audio_hidden_dim": 64,
"per_modality_projections": true
},
"vae": {
"in_channels": 3,
"out_channels": 3,
"latent_channels": 128,
"block_out_channels": [
16,
32
],
"decoder_block_out_channels": [
16
],
"layers_per_block": [
1,
1,
1
],
"decoder_layers_per_block": [
1,
1
],
"spatio_temporal_scaling": [
true,
true
],
"decoder_spatio_temporal_scaling": [
true
],
"downsample_type": [
"spatiotemporal",
"spatiotemporal"
],
"upsample_type": [
"spatiotemporal"
],
"upsample_residual": [
true
],
"upsample_factor": [
2
],
"patch_size": 4,
"patch_size_t": 1
},
"audio_vae": {
"base_channels": 8,
"output_channels": 2,
"ch_mult": [
1,
2
],
"num_res_blocks": 1,
"in_channels": 2,
"resolution": 64,
"latent_channels": 8,
"mel_bins": 4
},
"vocoder": {
"in_channels": 8,
"hidden_channels": 32,
"out_channels": 2,
"upsample_kernel_sizes": [
8,
8
],
"upsample_factors": [
4,
4
],
"resnet_kernel_sizes": [
3
],
"resnet_dilations": [
[
1,
1,
1
]
]
},
"text_encoder": {
"vocab_size": 262144,
"hidden_size": 8,
"intermediate_size": 16,
"num_hidden_layers": 2,
"num_attention_heads": 1,
"num_key_value_heads": 1,
"head_dim": 32,
"max_position_embeddings": 4096,
"tie_word_embeddings": true
}
}
|