Learning Timeline
Key Insights
RAM vs VRAM Requirements
While you can run LTX-2 on low VRAM (3GB), the total combined amount of physical RAM + VRAM must exceed 36GB (the cumulative model size) to prevent system crashes.
The Purpose of Reserve VRAM
Using the '--reserve-vram' parameter is crucial for Windows users to prevent background applications or the Windows UI from competing for VRAM with ComfyUI, which typically causes 'Out of Memory' errors.
Step by Step
Modifying Python Code for VRAM Management
- Open the ComfyUI installation folder on your computer.
- Navigate to the directory: 'ComfyUI' > 'comfy' > 'ldm' > 'modules'.
- Find the file named 'embeddings_connector.py'.
- Right-click on the file and select 'Edit with Notepad' or 'Open with VS Code'.
- Press 'Ctrl + F' to open the search function and type 'hidden_states = torch'.
- Locate the specific line of code related to processing those hidden states.
- Replace that line of code with the provided optimization code snippet (refer to the Snippet Card).
- Press 'Ctrl + S' to save your changes and close the text editor.
Optimizing Command Line Startup
- Locate the '.bat' file you use to launch ComfyUI.
- Right-click on the file and select 'Edit'.
- Go to the last line of code containing the 'python main.py' command.
- Add the parameter '--reserve-vram 4' to the end of that line to reserve 4GB of VRAM for OS use.
- If your VRAM is very low (under 4GB), replace that parameter with '--lowvram' or '--novram'.
- Press 'Ctrl + S' to save the file.
- Relaunch ComfyUI using the edited '.bat' file.
Speeding Up Video Generation
- Open the ComfyUI interface in your browser.
- Identify the 'Gemma 3 Text Encoder' node in your LTX-2 workflow.
- Click on the node to select it.
- Press 'Ctrl + B' on your keyboard to bypass the node.
- Ensure your prompt is high quality before bypassing to save compute time without affecting the video output.