- Home
- Skills
- Peteromallet
- Vibecomfy
- Comfy Nodes
comfy-nodes_skill
- Python
77
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill peteromallet/vibecomfy --skill comfy-nodes- SKILL.md3.5 KB
Overview
This skill helps you develop ComfyUI custom nodes by turning Python functions or scripts into node classes, defining INPUT_TYPES/RETURN_TYPES, and wiring them into ComfyUI. It guides conversion of common data types, batch handling, and the node registration pattern so your code runs correctly in ComfyUI pipelines.
How this skill works
I inspect your Python function or script to identify inputs, defaults, and outputs, then recommend a node class skeleton with INPUT_TYPES, RETURN_TYPES, RETURN_NAMES, FUNCTION, and CATEGORY. I convert common types (PIL, numpy, cv2, floats) to ComfyUI image/latent formats and show how to handle the batch dimension [B,H,W,C]. Finally I show how to register the node via NODE_CLASS_MAPPINGS and name mappings.
When to use it
- You have a Python image-processing function to run inside ComfyUI.
- You need to wrap a script into a reusable ComfyUI node for pipelines.
- You want to define INPUT_TYPES or RETURN_TYPES correctly for a node.
- You need help converting PIL/numpy/cv2 images to ComfyUI tensors.
- You want to ensure correct batch handling across B,H,W,C images.
Best practices
- Always define INPUT_TYPES as a @classmethod returning required/optional dicts.
- Return outputs as a tuple: return (result,) to match ComfyUI expectations.
- Process every batch item in execute and re-stack with torch.stack for outputs.
- Map Python types explicitly (PIL/numpy/cv2 -> IMAGE) and normalize to float 0-1.
- Use CATEGORY with slashes for submenus and set readable display names in mappings.
Example use cases
- Convert a PIL-based blur function into a node that accepts image and radius inputs.
- Wrap a cv2 script into a node that outputs a processed IMAGE tensor compatible with other nodes.
- Create a node exposing a model parameter (MODEL or VAE) alongside numeric controls.
- Build a node that returns CONDITIONING or LATENT objects for advanced pipelines.
- Quickly prototype custom transformations while preserving batch semantics.
FAQ
Always treat inputs as batch tensors [B,H,W,C]. For single images, unsqueeze a batch dim before processing and remove/add as needed so shape consistency is preserved.
What format should image tensors use?
Use float32 tensors normalized to 0-1 with channels in RGB. Convert PIL/numpy/cv2 to this format and back for per-item processing.