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
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 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/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 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/ImageChooser/__init__.py from 45th/comfyui-model-pack: direct link, hf CLI and curl.
- Browser
- Download file 3.38 kB
-
https://huggingface.co/45th/comfyui-model-pack/resolve/main/custom_nodes/ImageChooser/__init__.py
- Command line
-
hf download hf://45th/comfyui-model-pack/custom_nodes/ImageChooser/__init__.py
-
curl -L -o __init__.py https://huggingface.co/45th/comfyui-model-pack/resolve/main/custom_nodes/ImageChooser/__init__.py
3.38 kB
| import os | |
| import time | |
| import torch | |
| import folder_paths | |
| from server import PromptServer | |
| from aiohttp import web | |
| from PIL import Image | |
| import numpy as np | |
| CACHE_DIR = os.path.join(folder_paths.get_temp_directory(), "image_chooser_cache") | |
| os.makedirs(CACHE_DIR, exist_ok=True) | |
| # Глобальный словарь для связи бэкенда и фронтенда | |
| CHOICES = {} | |
| class ImageChooser: | |
| def __init__(self): | |
| pass | |
| def INPUT_TYPES(cls): | |
| return { | |
| "required": { | |
| "image_A": ("IMAGE",), | |
| "image_B": ("IMAGE",), | |
| }, | |
| "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO", "my_id": "UNIQUE_ID"}, | |
| } | |
| RETURN_TYPES = ("IMAGE",) | |
| FUNCTION = "execute" | |
| CATEGORY = "utils" | |
| # ЭТОТ МЕТОД РЕШАЕТ ПРОБЛЕМУ КЭША: | |
| # Возвращает текущее время. ComfyUI видит, что значение изменилось, | |
| # аннулирует кэш этой ноды и заставляет её запускаться при каждом Queue Prompt. | |
| def IS_CHANGED(cls, **kwargs): | |
| return time.time() | |
| def execute(self, image_A, image_B, prompt=None, extra_pnginfo=None, my_id=None): | |
| my_id_str = str(my_id) | |
| # Перезаписываем картинки свежими кадрами | |
| self.save_temp_image(image_A, f"{my_id_str}_A.png") | |
| self.save_temp_image(image_B, f"{my_id_str}_B.png") | |
| # Обязательно сбрасываем старый выбор пользователя для этой конкретной ноды | |
| CHOICES[my_id_str] = None | |
| # Отправляем сигнал браузеру открыть модальное окно | |
| PromptServer.instance.send_sync("image_chooser_wait", {"node_id": my_id_str}) | |
| print(f"[Image Chooser] Workflow paused. Waiting for user selection on node {my_id_str}...") | |
| # Ждем клика | |
| while CHOICES.get(my_id_str) is None: | |
| time.sleep(0.1) | |
| choice = CHOICES.pop(my_id_str) | |
| print(f"[Image Chooser] Pause lifted. Result received: {choice}") | |
| if choice == "CANCEL": | |
| raise Exception("Execution cancelled by user via Image Chooser.") | |
| if choice == "A": | |
| return (image_A,) | |
| else: | |
| return (image_B,) | |
| def save_temp_image(self, tensor, filename): | |
| if len(tensor.shape) == 4: | |
| img_np = tensor[0].cpu().numpy() | |
| else: | |
| img_np = tensor.cpu().numpy() | |
| img_np = np.clip(img_np * 255.0, 0, 255).astype(np.uint8) | |
| img = Image.fromarray(img_np) | |
| img.save(os.path.join(CACHE_DIR, filename)) | |
| async def handle_select(request): | |
| json_data = await request.json() | |
| node_id = str(json_data.get("node_id")) | |
| choice = json_data.get("choice") | |
| CHOICES[node_id] = choice | |
| return web.json_response({"status": "success"}) | |
| NODE_CLASS_MAPPINGS = { | |
| "ImageChooser": ImageChooser | |
| } | |
| NODE_DISPLAY_NAME_MAPPINGS = { | |
| "ImageChooser": "Image Chooser" | |
| } | |
| WEB_DIRECTORY = "." |