Registry / ai-ml / comfy-kitchen

comfy-kitchen

JSON →
library0.2.31pypypi✓ verified 24d ago

Comfy Kitchen is a fast kernel library designed for ComfyUI, offering optimized computational primitives with support for multiple compute backends such as PyTorch, JAX, and CuPy. It provides low-level, high-performance operations for AI workloads, allowing users to leverage different hardware and frameworks. The current version is 0.2.8, and it appears to follow a rapid iteration release cadence, indicating active development.

pip install comfy-kitchen
INSTALL
IMPORT
SIG · COMFY-KITCHEN
C
comfy-kitchen
ai-mlpythonv0.2.31
Install
2.8s avg
Import
Disk
129MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.31 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 2.9s
py 3.11
✓ —
✓ 2.8s
py 3.12
✓ —
✓ 2.68s
py 3.13
✓ —
✓ 2.78s
py 3.9
✕ build_error
✕ build_error
129MB installed
● package 129MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

comfy_kitchen
import comfy_kitchen
import comfy-kitchen

This quickstart demonstrates how to initialize Comfy Kitchen, set a compute backend (e.g., 'torch'), list available kernels, and load a specific kernel. It highlights the importance of installing optional backend dependencies and explicitly setting the backend before use.

import comfy_kitchen.kernels as K import os # --- Important: Choose and install a backend first --- # For this example, we default to 'torch'. # Ensure you have installed the corresponding extra, e.g., `pip install comfy-kitchen[torch]` try: backend_choice = os.environ.get('COMFY_KITCHEN_BACKEND', 'torch') K.set_backend(backend_choice) print(f"Successfully set Comfy Kitchen backend to: {backend_choice}") # List available kernels for the selected backend available_kernels = K.list_kernels() print(f"Available kernels for '{backend_choice}' backend: {', '.join(available_kernels)}") # Attempt to load an example kernel (e.g., a diffusion related one) kernel_name = "diffusion_forward" # Common kernel, but might vary per version/backend if kernel_name in available_kernels: kernel = K.load_kernel(kernel_name) print(f"Loaded kernel: {kernel.name} from backend: {K.get_backend()}") print(f"Kernel signature (expected inputs): {kernel.signature()}") # A full example would involve preparing inputs as per kernel.signature() # For demonstration, we just show successful loading and signature. # Example: to use, you'd prepare tensors (e.g., torch.Tensor) matching the signature # output = kernel.forward(*your_prepared_tensors_here) print("Kernel is ready for execution with appropriate input tensors.") else: print(f"Kernel '{kernel_name}' not found for backend '{backend_choice}'.") except ImportError as e: print(f"ERROR: Failed to import a backend. Did you run `pip install comfy-kitchen[{backend_choice}]`? Details: {e}") except Exception as e: print(f"An error occurred during Comfy Kitchen setup or kernel loading: {e}")
Debug
Known issues
gotchaComfy Kitchen relies on optional backend dependencies (e.g., 'torch', 'jax', 'cupy') which must be installed separately using pip extra commands. Attempting to use a backend without its corresponding dependency will result in an `ImportError` or runtime errors.
fix
Install with extras: `pip install comfy-kitchen[backend_name]` where `backend_name` is 'torch', 'jax', or 'cupy'.
affects: All versions
gotchaBefore loading any kernels, you must explicitly set the desired compute backend using `K.set_backend("torch")` (or "jax", "cupy", etc.). The library does not default to a backend, and attempting to load kernels without this step will raise an error.
fix
Call `K.set_backend("your_backend_choice")` early in your code, after importing `comfy_kitchen.kernels`.
affects: All versions
gotchaComfy Kitchen is a low-level kernel library providing optimized primitives. It is not a high-level wrapper for ComfyUI itself or a complete ComfyUI API client. Users might incorrectly assume it provides tools for general ComfyUI orchestration.
fix
Align expectations; this library is designed for specific kernel acceleration and high-performance operations, not for managing ComfyUI workflows or interacting with its UI layer.
affects: All versions
Upgrade
Version history
0.2.31latest on PyPI · released Aug 13, 2026
Audit
Dependencies
torchoptionalRequired for the 'torch' compute backend
jaxoptionalRequired for the 'jax' compute backend
cupyoptionalRequired for the 'cupy' compute backend
Agent activity
117 hits · last 30 days
node
110
OpenAI (training)
1
Resources
comfy-kitchen — pip install comfy-kitchen · libregistry