--- id: comfy-kitchen version: "0.2.31" license: Apache-2.0 license_treatment: permissive maintenance: active --- # comfy-kitchen — Fast Kernel Library for ComfyUI with multiple compute backends License: permissive · Maintenance: active · Downloads: 3.0M/mo ## What it is and what it does Comfy Kitchen is a GPU kernel library designed to accelerate quantized tensor computations in diffusion model inference. It provides low-level implementations of quantization (FP8, INT8, INT4, NVFP4, MXFP8), rotary position embeddings (RoPE), normalization-fusion operations (AdaLN, RMS-AdaLN), and attention kernels, each with backend-specific optimizations for NVIDIA CUDA, AMD HIP, Triton, and CPU eager execution. The library targets the ComfyUI ecosystem and is built to minimize memory bandwidth and latency by fusing operations and supporting in-place transformations. It includes a QuantizedTensor subclass that transparently routes PyTorch operations to optimized kernels. The HIP backend (for AMD RDNA2/3/3.5/4 GPUs) implements its own matrix-core GEMMs and quantization kernels without relying on hipBLAS, while RDNA2 (which lacks matrix cores) falls back to non-WMMA paths. The library is in alpha and actively maintained, with no external runtime dependencies beyond PyTorch. Use it for: - Accelerate diffusion model inference on NVIDIA GPUs by using FP8 quantization with CUDA-optimized kernels. - Deploy quantized diffusion models on AMD RDNA GPUs using the HIP backend without external BLAS libraries. - Reduce memory bandwidth in transformer attention by applying fused RoPE and AdaLN operations. - Integrate low-precision quantization (INT4, INT8) into ComfyUI workflows for faster generation. - Benchmark quantization strategies across multiple backends (CUDA, Triton, HIP) on the same hardware. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Comfy Kitchen provides optimized GPU kernels for quantized tensor operations in diffusion inference, supporting multiple compute backends (eager, CUDA, Triton, HIP) with operations like FP8/INT8/INT4 quantization, RoPE, AdaLN, and fused attention. Yes, with conditions. Install if you are building or optimizing diffusion inference in ComfyUI and have compatible GPU hardware (NVIDIA CUDA, AMD RDNA2+, or CPU). The library is actively maintained, has no external dependencies, and offers significant kernel-level optimizations. However, alpha status means the API and QuantizedTensor behavior may change; verify compatibility with your PyTorch and CUDA/ROCm versions before production use. Not necessary if you are not using ComfyUI or quantized inference. ## Install pip install comfy-kitchen uv add comfy-kitchen poetry add comfy-kitchen ## Installing comfy-kitchen Before you install: Actively maintained with a recent release (1 day old) and no runtime dependencies, making installation straightforward. Alpha status signals the API may evolve, but the project shows active development with 156 repository stars. License in practice: Apache-2.0 is permissive and poses no restrictions on commercial or proprietary use; you may use, modify, and distribute this package freely provided you retain the license notice. Quickstart: pip install comfy-kitchen import comfy_kitchen # Use quantization functions like quantize_per_tensor_fp8, apply_rope, adaln, etc. # Backend selected automatically based on available hardware (CUDA/HIP/Triton/eager) Requires Python >= 3.10. HIP backend on AMD GPUs requires ROCm toolchain; CUDA backend requires NVIDIA GPU and CUDA runtime. Building from source requires CMake >= 3.26 and Ninja. Verify before relying: - Whether QuantizedTensor subclass and its PyTorch operation interception are production-ready or still experimental. - Performance benchmarks comparing backends (CUDA vs. Triton vs. HIP) for common diffusion workloads. - Compatibility matrix with specific PyTorch versions and ROCm/CUDA versions. - Whether the library is actively used in production ComfyUI deployments or primarily in development. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytorch quantization kernels, diffusion inference optimization, gpu tensor quantization, cuda hip triton backends, fp8 int8 quantized operations, comfyui kernel library, low-precision tensor compute, gpu-kernels, quantization, diffusion-models [View on SkillFed](https://skillfed.io/packages/comfy-kitchen) · [View on PyPI](https://pypi.org/project/comfy-kitchen/)