Instructions to use Luzira/sdluz 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 Luzira/sdluz 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 Luzira/sdluz:Q4_K_M # Run inference directly in the terminal: llama cli -hf Luzira/sdluz:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Luzira/sdluz:Q4_K_M # Run inference directly in the terminal: llama cli -hf Luzira/sdluz:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Luzira/sdluz:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Luzira/sdluz:Q4_K_M
Use Docker
docker model run hf.co/Luzira/sdluz:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use Luzira/sdluz with Ollama:
ollama run hf.co/Luzira/sdluz:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Luzira/sdluz with Docker Model Runner:
docker model run hf.co/Luzira/sdluz:Q4_K_M
- Lemonade
How to use Luzira/sdluz with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Luzira/sdluz:Q4_K_M
Run and chat with the model
lemonade run user.sdluz-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download custom_nodes/ComfyUI-Custom-Scripts/py/constrain_image.py from Luzira/sdluz: direct link, hf CLI and curl.
- Browser
- Download file 2.89 kB
-
https://huggingface.co/Luzira/sdluz/resolve/main/custom_nodes/ComfyUI-Custom-Scripts/py/constrain_image.py
- Command line
-
hf download hf://Luzira/sdluz/custom_nodes/ComfyUI-Custom-Scripts/py/constrain_image.py
-
curl -L -o constrain_image.py https://huggingface.co/Luzira/sdluz/resolve/main/custom_nodes/ComfyUI-Custom-Scripts/py/constrain_image.py
2.89 kB
| import torch | |
| import numpy as np | |
| from PIL import Image | |
| class ConstrainImage: | |
| """ | |
| A node that constrains an image to a maximum and minimum size while maintaining aspect ratio. | |
| """ | |
| def INPUT_TYPES(cls): | |
| return { | |
| "required": { | |
| "images": ("IMAGE",), | |
| "max_width": ("INT", {"default": 1024, "min": 0}), | |
| "max_height": ("INT", {"default": 1024, "min": 0}), | |
| "min_width": ("INT", {"default": 0, "min": 0}), | |
| "min_height": ("INT", {"default": 0, "min": 0}), | |
| "crop_if_required": (["yes", "no"], {"default": "no"}), | |
| }, | |
| } | |
| RETURN_TYPES = ("IMAGE",) | |
| FUNCTION = "constrain_image" | |
| CATEGORY = "image" | |
| OUTPUT_IS_LIST = (True,) | |
| def constrain_image(self, images, max_width, max_height, min_width, min_height, crop_if_required): | |
| crop_if_required = crop_if_required == "yes" | |
| results = [] | |
| for image in images: | |
| i = 255. * image.cpu().numpy() | |
| img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)).convert("RGB") | |
| current_width, current_height = img.size | |
| aspect_ratio = current_width / current_height | |
| constrained_width = min(max(current_width, min_width), max_width) | |
| constrained_height = min(max(current_height, min_height), max_height) | |
| if constrained_width / constrained_height > aspect_ratio: | |
| constrained_width = max(int(constrained_height * aspect_ratio), min_width) | |
| if crop_if_required: | |
| constrained_height = int(current_height / (current_width / constrained_width)) | |
| else: | |
| constrained_height = max(int(constrained_width / aspect_ratio), min_height) | |
| if crop_if_required: | |
| constrained_width = int(current_width / (current_height / constrained_height)) | |
| resized_image = img.resize((constrained_width, constrained_height), Image.LANCZOS) | |
| if crop_if_required and (constrained_width > max_width or constrained_height > max_height): | |
| left = max((constrained_width - max_width) // 2, 0) | |
| top = max((constrained_height - max_height) // 2, 0) | |
| right = min(constrained_width, max_width) + left | |
| bottom = min(constrained_height, max_height) + top | |
| resized_image = resized_image.crop((left, top, right, bottom)) | |
| resized_image = np.array(resized_image).astype(np.float32) / 255.0 | |
| resized_image = torch.from_numpy(resized_image)[None,] | |
| results.append(resized_image) | |
| return (results,) | |
| NODE_CLASS_MAPPINGS = { | |
| "ConstrainImage|pysssss": ConstrainImage, | |
| } | |
| NODE_DISPLAY_NAME_MAPPINGS = { | |
| "ConstrainImage|pysssss": "Constrain Image 🐍", | |
| } | |