Qwen-Image-Edit-2511 INT4 (ComfyUI Optimized)
Model Details
This repository contains an INT4 quantized version of Qwen/Qwen-Image-Edit-2511, the powerful 20B-parameter image editing model from Alibaba's Qwen team. The model has been optimized for high-performance inference in ComfyUI using a custom W4A4 inference backend with direct CUDA kernel acceleration. It can achieve up to 2ร inference speedup over baseline INT4 implementations, reaching 1.66โ1.68 s/it on RTX 5090, making its performance on par with Nunchaku.
Quantization Method
This model uses SVDQuant, a post-training quantization technique that compresses both weights and activations to 4-bit precision (W4A4) while preserving visual fidelity through SVD-based low-rank decomposition and fused kernel execution. Unlike standard INT4 quantizations that often fall back to eager or dequantization paths, this implementation provides a fully native CUDA execution pipeline specifically tuned for ComfyUI environments.
Intended Uses & Environment
- Image editing in ComfyUI workflows, including portrait editing, text modification, lighting control, and material replacement.
- Hardware: Optimized for NVIDIA RTX 50-series (Blackwell) GPUs. Also supports Turing and later architectures with full INT4 acceleration.
- Framework: ComfyUI with
comfy-kitchencustom nodes.
Key Technical Optimizations
Native CUDA W4A4 Execution
Implemented a kitchen-native SVDQuant W4A4 CUDA path that avoids eager mode, dequantization, and Python/torch fallbacks. The TensorCoreSVDQuantW4A4Layout directly routes through quantize + scaled_mm on CUDA backend, ensuring ComfyUI can access native INT4 acceleration even when the global kitchen CUDA backend is restricted.
Split QKV with Shared Quantization
Preserved the split QKV model structure while eliminating redundant computation. At runtime, multiple split projections sharing the same smooth_factor/proj_down undergo activation INT4 quantization and LoRA-down projection only once, then feed into separate Q/K/V weight paths.
Tile-Packed Weight Format
Weights are reorganized from natural layout to a CTA-friendly tile-packed format (N/128, K/64, 32, 128), with matching wscales (N/128, K/64, 128) and LoRA-up (N/128, R, 128) layouts. This enables sequential global memory access patterns that reduce address computation and memory scattering.
Fused LoRA-Up Epilogue
The LoRA-up projection is fused directly into the INT4 GEMM kernel epilogue using bf16/fp16 tensor-core MMA, eliminating a separate addmm_ kernel launch and extra matrix read/write. This optimization was a primary contributor to reducing latency from ~3 s/it to the current 1.66โ1.68 s/it range.
Kernel Engineering
- 8 warps/CTA with
cp.async3-stage pipeline for optimal SM utilization - Split QKV fusion and LoRA-down staging in bf16/fp16 with workspace reuse
- Activation unsigned path with +0.171875 shift for post-GELU layers, matching Nunchaku conventions for model quality
- Shared scale staging in shared memory, delivering 2โ4% additional speedup with LoRA fused
- Register pressure optimization: Reduced register count from ~133โ140 to ~84โ87 on sm_120a
How to Use
Prerequisites
- ComfyUI with
comfy-kitchenextension installed - NVIDIA GPU (40-series recommended for optimal performance)
Model Loading
The model files are provided in safetensors format compatible with ComfyUI model loaders. Place the model files under ComfyUI/models/ and use a compatible loader node to integrate into your workflow.
Environment Variables
COMFY_KITCHEN_SVDQUANT_LORA_ACT_FP32=1: Force FP32 precision for LoRA activations (fallback option if quality issues suspected)
Model Quality & Compatibility
This INT4 quantization maintains visual fidelity on par with the original FP16/BF16 model. It follows Qwen-Image-Edit-2511's capabilities:
- Single and multi-image editing
- Text editing while preserving original style
- Character consistency and identity preservation
- Lighting control, material replacement, and geometric reasoning
- Support for both Chinese and English text editing
- Built-in high-frequency LoRA submodels
Citation
If you use this model, please cite both the original Qwen model and this optimized INT4 version:
@model{qwen-image-edit-2511-int4-comfy,
title = {Qwen-Image-Edit-2511 INT4 for ComfyUI with Native CUDA W4A4 Backend},
author = {LAXMAYDAY},
year = {2025},
url = {https://huggingface.co/LAXMAYDAY/qwen-image-edit-2511-int4-comfy}
}
Model tree for LAXMAYDAY/qwen-image-edit-2511-int4-comfy
Base model
Qwen/Qwen-Image-Edit-2511