Instructions to use vidfom/Ltx-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use vidfom/Ltx-3 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="vidfom/Ltx-3", filename="ComfyUI/models/text_encoders/gemma-3-12b-it-qat-UD-Q4_K_XL.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use vidfom/Ltx-3 with llama.cpp:
Install from brew
brew install llama.cpp # 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
Install from WinGet (Windows)
winget install llama.cpp # 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
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 Studio new
How to use vidfom/Ltx-3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vidfom/Ltx-3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vidfom/Ltx-3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for vidfom/Ltx-3 to start chatting
- 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
| import torch | |
| import copy | |
| from PIL import Image | |
| from .imagefunc import log, tensor2pil, pil2tensor, image2mask, chop_image, AnyType | |
| from .imagefunc import create_gradient, create_box_gradient, gaussian_blur, gamma_trans, mask_area | |
| any = AnyType("*") | |
| class CreateGradientMask: | |
| def __init__(self): | |
| self.NODE_NAME = 'CreateGradientMask' | |
| def INPUT_TYPES(self): | |
| side = ['bottom', 'top', 'left', 'right', 'center'] | |
| return { | |
| "required": { | |
| "width": ("INT", {"default": 512, "min": 4, "max": 99999, "step": 1}), | |
| "height": ("INT", {"default": 512, "min": 4, "max": 99999, "step": 1}), | |
| "gradient_side": (side,), | |
| "gradient_scale": ("INT", {"default": 100, "min": 1, "max": 9999, "step": 1}), | |
| "gradient_offset": ("INT", {"default": 0, "min": -9999, "max": 9999, "step": 1}), | |
| "opacity": ("INT", {"default": 100, "min": 0, "max": 100, "step": 1}), | |
| }, | |
| "optional": { | |
| "size_as": (any, {}), | |
| } | |
| } | |
| RETURN_TYPES = ("MASK",) | |
| RETURN_NAMES = ("mask",) | |
| FUNCTION = 'create_gradient_mask' | |
| CATEGORY = '😺dzNodes/LayerMask' | |
| def create_gradient_mask(self, width, height, gradient_side, gradient_scale, gradient_offset, opacity, size_as=None): | |
| if size_as is not None: | |
| if size_as.shape[0] > 0: | |
| _asimage = tensor2pil(size_as[0]) | |
| else: | |
| _asimage = tensor2pil(size_as) | |
| width, height = _asimage.size | |
| _black = Image.new('L', size=(width, height), color='black') | |
| _white = Image.new('L', size=(width, height), color='white') | |
| _canvas = copy.deepcopy(_black) | |
| debug_image1 = copy.deepcopy(_black).convert('RGB') | |
| debug_image2 = copy.deepcopy(_black).convert('RGB') | |
| start_color = '#FFFFFF' | |
| end_color = '#000000' | |
| if gradient_side == 'bottom': | |
| _gradient = create_gradient(start_color, end_color, width, height, direction='bottom') | |
| if gradient_scale != 100: | |
| _gradient = _gradient.resize((width, int(height * gradient_scale / 100))) | |
| _canvas.paste(_gradient.convert('L'), box=(0, gradient_offset)) | |
| if gradient_offset > height: | |
| _canvas = _white | |
| elif gradient_offset > 0: | |
| _canvas.paste(_white, box=(0, gradient_offset - height)) | |
| elif gradient_side == 'top': | |
| _gradient = create_gradient(start_color, end_color, width, height, direction='top') | |
| if gradient_scale != 100: | |
| _gradient = _gradient.resize((width, int(height * gradient_scale / 100))) | |
| _canvas.paste(_gradient.convert('L'), box=(0, height - int(height * gradient_scale / 100) + gradient_offset)) | |
| if gradient_offset < -height: | |
| _canvas = _white | |
| elif gradient_offset < 0: | |
| _canvas.paste(_white, box=(0, height + gradient_offset)) | |
| elif gradient_side == 'left': | |
| _gradient = create_gradient(start_color, end_color, width, height, direction='left') | |
| if gradient_scale != 100: | |
| _gradient = _gradient.resize((int(width * gradient_scale / 100), height)) | |
| _canvas.paste(_gradient.convert('L'), box=(width - int(width * gradient_scale / 100) + gradient_offset, 0)) | |
| if gradient_offset < -width: | |
| _canvas = _white | |
| elif gradient_offset < 0: | |
| _canvas.paste(_white, box=(width + gradient_offset, 0)) | |
| elif gradient_side == 'right': | |
| _gradient = create_gradient(start_color, end_color, width, height, direction='right') | |
| if gradient_scale != 100: | |
| _gradient = _gradient.resize((int(width * gradient_scale / 100), height)) | |
| _canvas.paste(_gradient.convert('L'), box=(gradient_offset, 0)) | |
| if gradient_offset > width: | |
| _canvas = _white | |
| elif gradient_offset > 0: | |
| _canvas.paste(_white, box=(gradient_offset - width, 0)) | |
| else: | |
| _gradient = create_box_gradient(start_color_inhex='#000000', end_color_inhex='#FFFFFF', | |
| width=width, height=height, scale=int(gradient_scale)) | |
| _gradient = _gradient.convert('L') | |
| debug_image1 = _gradient | |
| _blur_mask = Image.new('L', size=(width*2, height*2), color='black') | |
| _blur_mask.paste(_gradient, box=(int(width/2), int(height/2))) | |
| _blur_mask = gaussian_blur(_blur_mask, int((width + height) * gradient_scale / 100 / 16)) | |
| _gamma_mask = gamma_trans(_blur_mask, 0.15) | |
| (crop_x, crop_y, crop_width, crop_height) = mask_area(_gamma_mask) | |
| crop_box = (crop_x, crop_y, crop_x + crop_width, crop_y + crop_height) | |
| _blur_mask = _blur_mask.crop(crop_box) | |
| _blur_mask = _blur_mask.resize((width, height), Image.BILINEAR) | |
| if gradient_offset != 0: | |
| resize_width = int(width - gradient_offset) | |
| resize_height = int(height - gradient_offset) | |
| if resize_width < 1: | |
| resize_width = 1 | |
| if resize_height < 1: | |
| resize_height = 1 | |
| _blur_mask = _blur_mask.resize((resize_width, resize_height), Image.BILINEAR) | |
| paste_box = (int((width - resize_width) / 2), int((height - resize_height) / 2)) | |
| else: | |
| paste_box = (0,0) | |
| _canvas.paste(_blur_mask, box=paste_box) | |
| # opacity | |
| if opacity < 100: | |
| _canvas = chop_image(_black, _canvas, 'normal', opacity) | |
| log(f"{self.NODE_NAME} Processed.", message_type='finish') | |
| return (image2mask(_canvas),) | |
| NODE_CLASS_MAPPINGS = { | |
| "LayerMask: CreateGradientMask": CreateGradientMask | |
| } | |
| NODE_DISPLAY_NAME_MAPPINGS = { | |
| "LayerMask: CreateGradientMask": "LayerMask: CreateGradientMask" | |
| } |