skillfed

comfy-kitchen

Fast Kernel Library for ComfyUI with multiple compute backends

comfy-kitchen v0.2.31 3.0M downloads/30d#2,785 on PyPI156
Permissive license Apache-2.0 Active released

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 on this page — 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

comfy-kitchen on PyPI

pip

pip install comfy-kitchen

uv

uv add comfy-kitchen

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 3,022,578/month — #2,785 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: comfy_kitchen-0.2.31-py3-none-any.whl

Keywords: pytorch, cuda, quantization, kernels, diffusion

Development Status :: 3 - AlphaLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: C++Programming Language :: Python :: 3

Tags

pytorch quantization kernelsdiffusion inference optimizationgpu tensor quantizationcuda hip triton backendsfp8 int8 quantized operationscomfyui kernel librarylow-precision tensor compute
gpu-kernelsquantizationdiffusion-models

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

humming-kernels

Humming is a JIT-compiled GEMM kernel library…

unclear · top 5,000 on PyPI

nvidia-cudnn-frontend

Provides Python and C++ APIs to NVIDIA's cuDNN…

permissive · top 5,000 on PyPI

causal-conv1d

Implements a CUDA-optimized causal depthwise 1D…

permissive · top 15,000 on PyPI

optimum-quanto

A PyTorch quantization backend that reduces…

permissive · top 15,000 on PyPI

flashinfer-python

FlashInfer provides optimized GPU kernels for…

permissive · top 5,000 on PyPI

transformer-engine-cu12

Accelerates Transformer model training and…

unclear · top 15,000 on PyPI

flashinfer-cubin

Provides pre-compiled GPU kernel binaries…

permissive · top 5,000 on PyPI

compressed-tensors

Provides a unified format for storing and…

permissive · top 5,000 on PyPI

cuequivariance-ops-torch-cu12

Provides CUDA-accelerated PyTorch kernels and…

unclear · top 15,000 on PyPI

cpm-kernels

Provides CUDA kernels optimized for CPM,…

permissive · top 15,000 on PyPI

Further reading