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
- 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"
Upload simple_latent_passthrough.py
Browse files
custom_nodes/simple_latent_passthrough.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
|
| 3 |
+
class SimpleLatentPassthrough:
|
| 4 |
+
def __init__(self):
|
| 5 |
+
pass
|
| 6 |
+
|
| 7 |
+
@classmethod
|
| 8 |
+
def INPUT_TYPES(s):
|
| 9 |
+
# ИСПРАВЛЕНО: Ключи приведены к нижнему регистру, теперь входы отобразятся в интерфейсе
|
| 10 |
+
return {
|
| 11 |
+
"required": {},
|
| 12 |
+
"optional": {
|
| 13 |
+
"latent_1": ("LATENT",),
|
| 14 |
+
"latent_2": ("LATENT",),
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
RETURN_TYPES = ("LATENT",)
|
| 19 |
+
FUNCTION = "route_latent"
|
| 20 |
+
CATEGORY = "latent"
|
| 21 |
+
|
| 22 |
+
def route_latent(self, latent_1=None, latent_2=None):
|
| 23 |
+
# Сценарий 1: Активен только первый метод (второй отключен)
|
| 24 |
+
if latent_1 is not None and latent_2 is None:
|
| 25 |
+
return (latent_1,)
|
| 26 |
+
|
| 27 |
+
# Сценарий 2: Активен только второй метод (первый отключен)
|
| 28 |
+
if latent_2 is not None and latent_1 is None:
|
| 29 |
+
return (latent_2,)
|
| 30 |
+
|
| 31 |
+
# Сценарий 3: Если включены обе группы сразу
|
| 32 |
+
if latent_1 is not None and latent_2 is not None:
|
| 33 |
+
try:
|
| 34 |
+
# Так как в ComfyUI нельзя сделать физическое разделение "кто быстрее пришел" (обе ветки считаются параллельно
|
| 35 |
+
# и приходят в ноду одновременно), лучшим решением для реализации вашего правила "пропустить каждый по очереди"
|
| 36 |
+
# является объединение их в латентный батч (пакет).
|
| 37 |
+
# В этом случае KSampler и последующие ноды обработают их последовательно один за другим.
|
| 38 |
+
samples_1 = latent_1["samples"]
|
| 39 |
+
samples_2 = latent_2["samples"]
|
| 40 |
+
|
| 41 |
+
# Склеиваем тензоры по размерности батча (dim=0)
|
| 42 |
+
batched_samples = torch.cat((samples_1, samples_2), dim=0)
|
| 43 |
+
|
| 44 |
+
result = latent_1.copy()
|
| 45 |
+
result["samples"] = batched_samples
|
| 46 |
+
return (result,)
|
| 47 |
+
except Exception as e:
|
| 48 |
+
# Если латенты разного разрешения и склеить их в батч нельзя, отдаем приоритет первому
|
| 49 |
+
return (latent_1,)
|
| 50 |
+
|
| 51 |
+
# Сценарий 4: Если оба входа оказались пустыми
|
| 52 |
+
raise ValueError("SimpleLatentPassthrough: Оба входа пусты. Включите хотя бы одну группу апскейла.")
|
| 53 |
+
|
| 54 |
+
# Регистрация ноды в ComfyUI
|
| 55 |
+
NODE_CLASS_MAPPINGS = {
|
| 56 |
+
"SimpleLatentPassthrough": SimpleLatentPassthrough
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
NODE_DISPLAY_NAME_MAPPINGS = {
|
| 60 |
+
"SimpleLatentPassthrough": "Simple Latent Passthrough (Dynamic)"
|
| 61 |
+
}
|