comfy-nodes

comfy-nodes is a skill for Claude Code, Codex from ConstantineB6/comfy-pilot. It costs 54 tokens per session (964 once invoked), scanned A, original, MIT.

A guide to turning Python code into custom nodes for ComfyUI, a visual tool for building image-generation workflows. It covers the node class structure and how nodes describe their inputs and outputs.

In plain words
What is it for?
Use it to create a ComfyUI custom node, wrap an existing Python script, or define input types, return types, node classes, and execution methods.
Why use it?
It removes the need to work out how ordinary Python functions must be reshaped for ComfyUI to use them. It also helps avoid mismatches between the values a node accepts and returns.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/constantineb6/comfy-pilot/comfy-nodes
Any agent
npx skills add ConstantineB6/comfy-pilot --skill comfy-nodes
Clone the repo
git clone --depth 1 https://github.com/ConstantineB6/comfy-pilot

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for comfy-nodes

README.md
[![agentmods](https://agentmods.dev/badge/skills/constantineb6/comfy-pilot/comfy-nodes.svg)](https://agentmods.dev/skills/constantineb6/comfy-pilot/comfy-nodes)
Your own site
<a href="https://agentmods.dev/skills/constantineb6/comfy-pilot/comfy-nodes"><img src="https://agentmods.dev/badge/skills/constantineb6/comfy-pilot/comfy-nodes.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 964 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00054 $0.00964
Opus 5 $0.00027 $0.00482
Sonnet 5 $0.00011 $0.00193
Haiku 4.5 $0.00005 $0.00096

Measured 5d ago against content hash f63482c70115, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

comfy-nodes scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/comfy-nodes/SKILL.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ComfyUI Custom Node Development

This skill helps you create custom ComfyUI nodes from Python code.

Quick Template

class MyNode:
    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "image": ("IMAGE",),
                "value": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0}),
            },
            "optional": {
                "mask": ("MASK",),
            }
        }

    RETURN_TYPES = ("IMAGE",)
    RETURN_NAMES = ("output",)
    FUNCTION = "execute"
    CATEGORY = "Custom/MyNodes"

    def execute(self, image, value, mask=None):
        result = image * value
        return (result,)

NODE_CLASS_MAPPINGS = {"MyNode": MyNode}
NODE_DISPLAY_NAME_MAPPINGS = {"MyNode": "My Node"}

Converting Python to Node

When you have Python code to wrap:

Step 1: Identify inputs and outputs

# Original function
def apply_blur(image, radius=5):
    from PIL import ImageFilter
    return image.filter(ImageFilter.GaussianBlur(radius))

Step 2: Map types

Python Type ComfyUI Type Conversion
PIL Image IMAGE torch.from_numpy(np.array(pil) / 255.0)
numpy array IMAGE torch.from_numpy(arr.astype(np.float32))
cv2 BGR IMAGE torch.from_numpy(cv2.cvtColor(img, cv2.COLOR_BGR2RGB) / 255.0)
float 0-255 IMAGE Divide by 255.0
Single image Batch tensor.unsqueeze(0)

Step 3: Handle batch dimension

ComfyUI images are [B,H,W,C] - always process all batch items:

def execute(self, image, radius):
    batch_results = []
    for i in range(image.shape[0]):
        # Convert to PIL
        img_np = (image[i].cpu().numpy() * 255).astype(np.uint8)
        pil_img = Image.fromarray(img_np)

        # Your processing
        result = pil_img.filter(ImageFilter.GaussianBlur(radius))

        # Convert back
        result_np = np.array(result).astype(np.float32) / 255.0
        batch_results.append(torch.from_numpy(result_np))

    return (torch.stack(batch_results),)

Read the full file on GitHub · 123 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 123 lines · 54 tokens per session scan A f63482c70115

Subscribe to this mod's changes

comfy-nodes is a skill published in the GitHub repository ConstantineB6/comfy-pilot (231 stars, last pushed 6mo ago), licensed MIT. It adds 54 tokens to every session and 964 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

civitai-depot

Discover Civitai models and pin weights into the comfyops models depot.

sandraschi/civitai-mcp · 21 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

ViewComfy/ViewComfy · 67 tokens

web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

ViewComfy/ViewComfy · 44 tokens

repomix

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

yamadashy/repomix · 58 tokens

agent-carnet

Use this skill when the user asks to save, recall, find, or organize notes. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check the notebook', 'find in carnet'. Also use proactively when discovering findings worth preserving across sessions.

yamadashy/repomix · 67 tokens

google-agents-cli-scaffold

This skill should be used when the user wants to "create an agent project", "start a new ADK project", "build me a new agent", "add CI/CD to my project", "add deployment", "enhance my project", or "upgrade my project". Part of the agents-cli skills suite. Covers agents-cli scaffold create, scaffold enhance, and…

google/agents-cli · 135 tokens