Instructions to use 45th/comfyui-model-pack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use 45th/comfyui-model-pack with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("45th/comfyui-model-pack", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use 45th/comfyui-model-pack 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 45th/comfyui-model-pack # Run inference directly in the terminal: llama cli -hf 45th/comfyui-model-pack
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf 45th/comfyui-model-pack # Run inference directly in the terminal: llama cli -hf 45th/comfyui-model-pack
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 45th/comfyui-model-pack # Run inference directly in the terminal: ./build/bin/llama cli -hf 45th/comfyui-model-pack
Use Docker
docker model run hf.co/45th/comfyui-model-pack
- Llama new
- LM Studio
- Jan
- Ollama
How to use 45th/comfyui-model-pack with Ollama:
ollama run hf.co/45th/comfyui-model-pack
- Unsloth Desktop
- Pi
How to use 45th/comfyui-model-pack with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 45th/comfyui-model-pack
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "45th/comfyui-model-pack" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use 45th/comfyui-model-pack with Docker Model Runner:
docker model run hf.co/45th/comfyui-model-pack
- Lemonade
How to use 45th/comfyui-model-pack with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull 45th/comfyui-model-pack
Run and chat with the model
lemonade run user.comfyui-model-pack-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use 45th/comfyui-model-pack with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 45th/comfyui-model-pack
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default 45th/comfyui-model-pack
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use 45th/comfyui-model-pack with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 45th/comfyui-model-pack
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "45th/comfyui-model-pack" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download custom_nodes/save_image_jpeg.py from 45th/comfyui-model-pack: direct link, hf CLI and curl.
- Browser
- Download file 4.45 kB
-
https://huggingface.co/45th/comfyui-model-pack/resolve/main/custom_nodes/save_image_jpeg.py
- Command line
-
hf download hf://45th/comfyui-model-pack/custom_nodes/save_image_jpeg.py
-
curl -L -o save_image_jpeg.py https://huggingface.co/45th/comfyui-model-pack/resolve/main/custom_nodes/save_image_jpeg.py
4.45 kB
| import os | |
| import re | |
| import numpy as np | |
| from datetime import datetime | |
| from PIL import Image, ImageCms | |
| import folder_paths | |
| # Standard Apple ImageIO DQT Quantization Tables for JPEG (Luminance & Chrominance) | |
| APPLE_DQT_LUMA = [ | |
| 2, 1, 1, 2, 2, 4, 5, 6, | |
| 1, 1, 1, 2, 3, 6, 6, 6, | |
| 1, 1, 2, 2, 4, 6, 7, 6, | |
| 1, 2, 2, 3, 5, 9, 8, 7, | |
| 2, 2, 4, 6, 7, 11, 10, 8, | |
| 2, 3, 5, 6, 8, 10, 11, 9, | |
| 5, 6, 8, 9, 10, 12, 12, 10, | |
| 7, 9, 9, 10, 11, 10, 10, 10 | |
| ] | |
| APPLE_DQT_CHROMA = [ | |
| 2, 2, 2, 4, 8, 8, 8, 8, | |
| 2, 2, 3, 5, 8, 8, 8, 8, | |
| 2, 3, 5, 8, 8, 8, 8, 8, | |
| 4, 5, 8, 8, 8, 8, 8, 8, | |
| 8, 8, 8, 8, 8, 8, 8, 8, | |
| 8, 8, 8, 8, 8, 8, 8, 8, | |
| 8, 8, 8, 8, 8, 8, 8, 8, | |
| 8, 8, 8, 8, 8, 8, 8, 8 | |
| ] | |
| def process_filename_prefix(prefix): | |
| def replace_date(match): | |
| fmt_str = match.group(1) | |
| replacements = [ | |
| ("yyyy", "%Y"), ("YY", "%y"), ("yy", "%y"), | |
| ("MM", "%m"), ("dd", "%d"), | |
| ("HH", "%H"), ("hh", "%H"), | |
| ("mm", "%M"), ("ss", "%S") | |
| ] | |
| for old, new in replacements: | |
| fmt_str = fmt_str.replace(old, new) | |
| return datetime.now().strftime(fmt_str) | |
| prefix = re.sub(r"%date:([^%]+)%", replace_date, prefix) | |
| return prefix | |
| class SaveImageJPEG: | |
| def __init__(self): | |
| self.output_dir = folder_paths.get_output_directory() | |
| self.type = "output" | |
| self.prefix_append = "" | |
| # Generate binary sRGB IEC61966-2.1 ICC profile | |
| srgb_profile = ImageCms.createProfile("sRGB") | |
| self.srgb_icc_bytes = ImageCms.ImageCmsProfile(srgb_profile).tobytes() | |
| def INPUT_TYPES(s): | |
| return { | |
| "required": { | |
| "Images": ("IMAGE", {"tooltip": "Input images tensor to save."}), | |
| "Filename Prefix": ("STRING", {"default": "iPhone_JPEG"}), | |
| "Quality": ("INT", {"default": 88, "min": 1, "max": 100, "step": 1, "tooltip": "JPEG Quality factor (Apple default is 85-90%)."}), | |
| "Use Apple JPEG Tables": ("BOOLEAN", {"default": True, "tooltip": "Use custom Apple DQT quantization tables."}), | |
| "Subsampling": (["4:2:0", "4:2:2", "4:4:4"], {"default": "4:2:0", "tooltip": "Chroma subsampling mode (Apple default is 4:2:0)."}), | |
| }, | |
| } | |
| RETURN_TYPES = () | |
| FUNCTION = "save_images" | |
| OUTPUT_NODE = True | |
| CATEGORY = "📸 shots by Faded/Utils" | |
| DESCRIPTION = "Saves JPEG images matching Apple's compression profile with dynamic date formatting." | |
| def save_images(self, Images, **kwargs): | |
| filename_prefix = kwargs.get("Filename Prefix", "iPhone_JPEG") | |
| quality = kwargs.get("Quality", 88) | |
| use_apple_jpeg_tables = kwargs.get("Use Apple JPEG Tables", True) | |
| subsampling = kwargs.get("Subsampling", "4:2:0") | |
| filename_prefix += self.prefix_append | |
| filename_prefix = process_filename_prefix(filename_prefix) | |
| full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path( | |
| filename_prefix, self.output_dir, Images[0].shape[2], Images[0].shape[1] | |
| ) | |
| results = list() | |
| qtables_param = [APPLE_DQT_LUMA, APPLE_DQT_CHROMA] if use_apple_jpeg_tables else None | |
| for (batch_number, image) in enumerate(Images): | |
| # Convert PyTorch tensor (float 0..1) to PIL Image (uint8 0..255 RGB) | |
| i = 255. * image.cpu().numpy() | |
| img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)) | |
| file = f"{filename}_{counter:05}_.jpg" | |
| file_path = os.path.join(full_output_folder, file) | |
| img.save( | |
| file_path, | |
| format="JPEG", | |
| quality=quality, | |
| subsampling=subsampling, | |
| progressive=False, | |
| qtables=qtables_param, | |
| icc_profile=self.srgb_icc_bytes, | |
| ) | |
| results.append({ | |
| "filename": file, | |
| "subfolder": subfolder, | |
| "type": self.type | |
| }) | |
| counter += 1 | |
| return {"ui": {"images": results}} | |
| NODE_CLASS_MAPPINGS = { | |
| "SaveImageJPEG": SaveImageJPEG | |
| } | |
| NODE_DISPLAY_NAME_MAPPINGS = { | |
| "SaveImageJPEG": "Save Image (JPEG)" | |
| } |