Instructions to use vidfom/Ltx-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use vidfom/Ltx-3 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf vidfom/Ltx-3:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf vidfom/Ltx-3:UD-Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf vidfom/Ltx-3:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf vidfom/Ltx-3:UD-Q4_K_XL
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf vidfom/Ltx-3:UD-Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf vidfom/Ltx-3:UD-Q4_K_XL
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf vidfom/Ltx-3:UD-Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf vidfom/Ltx-3:UD-Q4_K_XL
Use Docker
docker model run hf.co/vidfom/Ltx-3:UD-Q4_K_XL
- LM Studio
- Jan
- Ollama
How to use vidfom/Ltx-3 with Ollama:
ollama run hf.co/vidfom/Ltx-3:UD-Q4_K_XL
- Unsloth Desktop
- Docker Model Runner
How to use vidfom/Ltx-3 with Docker Model Runner:
docker model run hf.co/vidfom/Ltx-3:UD-Q4_K_XL
- Lemonade
How to use vidfom/Ltx-3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull vidfom/Ltx-3:UD-Q4_K_XL
Run and chat with the model
lemonade run user.Ltx-3-UD-Q4_K_XL
List all available models
lemonade list
- Atomic Chat
Download ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/testframework/server.py from vidfom/Ltx-3: direct link, hf CLI and curl.
- Browser
- Download file 2.84 kB
-
https://huggingface.co/vidfom/Ltx-3/resolve/main/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/testframework/server.py
- Command line
-
hf download hf://vidfom/Ltx-3/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/testframework/server.py
-
curl -L -o server.py https://huggingface.co/vidfom/Ltx-3/resolve/main/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/testframework/server.py
2.84 kB
| import subprocess | |
| import json | |
| import os | |
| import torch | |
| import shutil | |
| import server | |
| import folder_paths | |
| web = server.web | |
| async def test(request): | |
| try: | |
| req_data = await request.json() | |
| output = req_data['output']['gifs'][0] | |
| filename = output['filename'] | |
| typ = output['type'] | |
| base_args = ["ffprobe", "-v", "error", '-count_packets', "-show_entries", "stream", "-of", "json"] | |
| video = folder_paths.get_annotated_filepath(f'{filename} [{typ}]') | |
| vprobe = json.loads(subprocess.run(base_args + ['-select_streams', 'v:0', video], | |
| capture_output=True, check=True).stdout)['streams'][0] | |
| aprobe = json.loads(subprocess.run(base_args + ['-select_streams', 'a:0', video], | |
| capture_output=True, check=True).stdout)['streams'] | |
| probe = {'video': vprobe} | |
| if len(aprobe) > 0: | |
| probe['audio'] = aprobe[0] | |
| errors = [] | |
| compare = None | |
| for test in req_data['tests']: | |
| if test['type'] == 'compare': | |
| compare = test | |
| continue | |
| key = test['key'] | |
| expected = test['value'] | |
| actual = probe[test['type']][key] | |
| if expected != actual: | |
| #Consider always dumping type? | |
| errors.append(f'{key}: {expected} != {actual}') | |
| if len(errors) == 0 and compare is not None: | |
| if not os.path.exists(compare['filename']): | |
| os.makedirs(os.path.split(compare['filename'])[0], exist_ok=True) | |
| shutil.copy(video, compare['filename']) | |
| print("Missing comparison file has been initialized from output:", os.path.abspath(compare['filename'])) | |
| else: | |
| #NOTE: This does not include the full memory optimizations of VHS | |
| #Tests should be small | |
| #TODO: Figure out way to do opacity comparison. May need to do blending in python | |
| #(easy, but slower and more memory intensive) | |
| diff = subprocess.run(['ffmpeg', '-v', 'error', '-i', video, '-i', compare['filename'], '-filter_complex', 'blend=all_mode=grainextract', '-pix_fmt', 'rgb24', '-f', 'rawvideo', '-'], stdout=subprocess.PIPE, check=True).stdout | |
| diff = torch.frombuffer(diff, dtype=torch.uint8).to(dtype=torch.float32).div_(255) | |
| #diff = diff.reshape((-1,4)) | |
| d = (diff-0.5).abs().sum()/diff.size(0) | |
| if d > compare['tolerance']: | |
| errors.append(f'Similarity is outside specified tolerance: {d}') | |
| else: | |
| print('d:', d) | |
| return web.json_response(errors) | |
| except Exception as e: | |
| return web.json_response(str(e)) | |