Creating high-quality, realistic videos on demand has always been a challenging task, until now. Trending on Hugging Face, LTX-Video by Lightricks, is the first-of-its-kind video generation model built on the DiT (Denoising Diffusion Transformer) architecture. What sets LTX apart is its ability to generate stunning 30 FPS videos at a 1216×704 resolution in real-time, meaning it can render videos faster than you can watch them. From animating a scene from a simple text prompt to bringing a static image to life with an accompanying narrative, LTX handles both text-to-video and image-text-to-video generation with impressive quality and speed. Trained on a massive and diverse video dataset, it delivers not only high fidelity but also rich content diversity, making each output feel authentic and visually compelling. It can be used for rapid prototyping and content creation or storytelling and entertainment. LTX-Video opens up new creative possibilities for developers, artists, and video enthusiasts.
In this guide, we’ll walk you through the step-by-step installation of this model and how to generated videos from both text and images in seconds.
Prerequisites
The minimum system requirements for running this model are:
Step-by-step process to install and run LTX-Video by Lightricks
For the purpose of this tutorial, we’ll use a GPU-powered Virtual Machine by NodeShift since it provides high compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. Also, it offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider of your choice and follow the same steps for the rest of the tutorial.
Step 1: Setting up a NodeShift Account
Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.
If you already have an account, login straight to your dashboard.
Step 2: Create a GPU Node
After accessing your account, you should see a dashboard (see image), now:
- Navigate to the menu on the left side.
- Click on the GPU Nodes option.
- Click on Start to start creating your very first GPU node.
These GPU nodes are GPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations for GPUs ranging from H100s to A100s, CPUs, RAM, and storage, according to your needs.
Step 3: Selecting configuration for GPU (model, region, storage)
- For this tutorial, we’ll be using 1x RTX A6000 GPU, however, you can choose any GPU as per the prerequisites.
- Similarly, we’ll opt for 200GB storage by sliding the bar. You can also select the region where you want your GPU to reside from the available ones.
Step 4: Choose GPU Configuration and Authentication method
- After selecting your required configuration options, you’ll see the available GPU nodes in your region and according to (or very close to) your configuration. In our case, we’ll choose a 1x RTX A6000 48GB GPU node with 64vCPUs/63GB RAM/200GB SSD.
2. Next, you’ll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.
Step 5: Choose an Image
The final step is to choose an image for the VM, which in our case is Nvidia Cuda.
That’s it! You are now ready to deploy the node. Finalize the configuration summary, and if it looks good, click Create to deploy the node.
Step 6: Connect to active Compute Node using SSH
- As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!
- Once your GPU shows this status, navigate to the three dots on the right, click on Connect with SSH, and copy the SSH details that appear.
As you copy the details, follow the below steps to connect to the running GPU VM via SSH:
- Open your terminal, paste the SSH command, and run it.
2. In some cases, your terminal may take your consent before connecting. Enter ‘yes’.
3. A prompt will request a password. Type the SSH password, and you should be connected.
Output:
Next, If you want to check the GPU details, run the following command in the terminal:
!nvidia-smi
Step 7: Set up the project environment with dependencies
- Create a virtual environment using Anaconda.
conda create -n ltx python=3.10 -y && conda activate ltx
Output:
2. Once you’re inside the environment, install necessary dependencies to run the model.
pip install torch>=2.1.2 torchvision torchaudio einops timm pillow
pip install git+https://github.com/huggingface/transformers
pip install git+https://github.com/huggingface/accelerate
pip install -U git+https://github.com/huggingface/diffusers
pip install huggingface_hub
pip install sentencepiece bitsandbytes protobuf decord numpy ffmpeg-python
Output:
3. Clone the official repository of LTX-Video.
git clone https://github.com/Lightricks/LTX-Video.git
Output:
4. Move inside the project directory and run the following command to install the current directory as a package in editable mode, and also installs other dependencies specified under the inference-script
.
cd LTX-Video
pip install -e .\[inference-script\]
Output:
5. Install and run jupyter notebook.
conda install -c conda-forge --override-channels notebook -y
conda install -c conda-forge --override-channels ipywidgets -y
jupyter notebook --allow-root
6. If you’re on a remote machine (e.g., NodeShift GPU), you’ll need to do SSH port forwarding in order to access the jupyter notebook session on your local browser.
Run the following command in your local terminal after replacing:
<YOUR_SERVER_PORT>
with the PORT allotted to your remote server (For the NodeShift server – you can find it in the deployed GPU details on the dashboard).
<PATH_TO_SSH_KEY>
with the path to the location where your SSH key is stored.
<YOUR_SERVER_IP>
with the IP address of your remote server.
ssh -L 8888:localhost:8888 -p <YOUR_SERVER_PORT> -i <PATH_TO_SSH_KEY> root@<YOUR_SERVER_IP>
Output:
After this copy the URL you received in your remote server:
And paste this on your local browser to access the Jupyter Notebook session.
Step 8: Download and Run the model
- Open a Python notebook inside Jupyter.
2. Download the model and run it for inference.
For Text-to-Video:
import torch
from diffusers import LTXPipeline
from diffusers.utils import export_to_video
pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
pipe.to("cuda")
prompt = "A woman with blood on her face and a white tank top looks down and to her right, then back up as she speaks. She has dark hair pulled back, light skin, and her face and chest are covered in blood. The camera angle is a close-up, focused on the woman's face and upper torso. The lighting is dim and blue-toned, creating a somber and intense atmosphere. The scene appears to be from a movie or TV show."
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
video = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
width=704,
height=480,
num_frames=161,
num_inference_steps=50,
).frames[0]
export_to_video(video, "output.mp4", fps=24)
Output:
Once the video generation is complete, you can find the output.mp4
stated above in the Home page of Jupyter Notebook session. Download the video from here to run and see it in your local machine.
Here’s the output video generated for the given prompt:
Prompt 1: “A woman with blood on her face and a white tank top looks down and to her right, then back up as she speaks. She has dark hair pulled back, light skin, and her face and chest are covered in blood. The camera angle is a close-up, focused on the woman’s face and upper torso. The lighting is dim and blue-toned, creating a somber and intense atmosphere. The scene appears to be from a movie or TV show.”
Video:
https://drive.google.com/file/d/1yjlFUJr_xZf4fW5vKUqo1e48WajUC_vM/view?usp=sharing
Prompt 2: “A woman walks away from a white Jeep parked on a city street at night, then ascends a staircase and knocks on a door. The woman, wearing a dark jacket and jeans, walks away from the Jeep parked on the left side of the street, her back to the camera; she walks at a steady pace, her arms swinging slightly by her sides; the street is dimly lit, with streetlights casting pools of light on the wet pavement; a man in a dark jacket and jeans walks past the Jeep in the opposite direction; the camera follows the woman from behind as she walks up a set of stairs towards a building with a green door; she reaches the top of the stairs and turns left, continuing to walk towards the building; she reaches the door and knocks on it with her right hand; the camera remains stationary, focused on the doorway; the scene is captured in real-life footage.”
Video: https://drive.google.com/file/d/1SGxYi2m-vem253lBwprF6k4uBr2-JUZt/view?usp=drive_link
For Image-to-Video:
With LTX, you can also generate videos using any image to provide as the inspiration to model. Use the given code snippet to do that:
import torch
from diffusers import LTXImageToVideoPipeline
from diffusers.utils import export_to_video, load_image
pipe = LTXImageToVideoPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
pipe.to("cuda")
image = load_image(
"https://huggingface.co/datasets/a-r-r-o-w/tiny-meme-dataset-captioned/resolve/main/images/8.png"
)
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."
negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
video = pipe(
image=image,
prompt=prompt,
negative_prompt=negative_prompt,
width=704,
height=480,
num_frames=161,
num_inference_steps=50,
).frames[0]
export_to_video(video, "output.mp4", fps=24)
Here’s the output we received for the given image:
Image:
Video:
https://drive.google.com/file/d/1doEH9JA8eEoBFaBA8bhyyGF5_XNpVdiB/view?usp=drive_link
3. To run the inference through CLI, use this command:
For Text-to-Video:
(Replace PROMPT
with the prompt of your choice.)
python inference.py --prompt "PROMPT" --height HEIGHT --width WIDTH --num_frames NUM_FRAMES --seed SEED --pipeline_config ltxv-13b-0.9.7-dev.yaml
For Image-to-Video:
(Replace PROMPT
with the prompt of your choice, )
python inference.py --prompt "PROMPT" --input_image_path IMAGE_PATH --height HEIGHT --width WIDTH --num_frames NUM_FRAMES --seed SEED --pipeline_config ltxv-13b-0.9.7-dev.yaml
And as before, you can find the results generated in Home page of Jupyter Notebook session.
Conclusion
LTX-Video by Lightricks showcases the powerful capabilies of diffusers based video generation, offering real-time, high-resolution video creation from both text and images. With its DiT-based architecture and powerful training on diverse datasets, it empowers creators to produce vivid, cinematic content in seconds. Running such a high-performance model demands reliable infrastructure, and that’s where NodeShift comes in. With seamless GPU access, fast deployment tools, and a developer-friendly environment, NodeShift makes it easy to experiment, scale, and create with LTX-Video without worrying about the backend.