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:9931/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:9931/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:9931/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"
File size: 3,379 Bytes
ee0d610 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | 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
@classmethod
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.
@classmethod
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))
@PromptServer.instance.routes.post("/image_chooser/select")
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 = "." |