ComfyUI Extension: comfyui-sdnq
ComfyUI custom node pack for loading SDNQ quantized models
Custom Nodes (0)
README
ComfyUI-SDNQ
Load SDNQ quantized models in ComfyUI with 50-75% VRAM savings!
This custom node pack enables loading SDNQ (SD.Next Quantization) models in ComfyUI workflows. Run large models like FLUX.2, FLUX.1, Qwen-Image, Z-Image, HunyuanImage3, and more on consumer hardware with significantly reduced VRAM requirements while maintaining image quality.
SDNQ is developed by Disty0 - this node pack provides ComfyUI integration.
Features
- 📦 Model Dropdown: Select from pre-configured SDNQ models from Disty0's collection
- ⚡ Auto-Download: Models download automatically from HuggingFace on first use
- 💾 Smart Caching: Download once, use forever
- 🚀 VRAM Savings: 50-75% memory reduction with quantization
- 🎨 Quality Maintained: Minimal quality loss with high-quality quantization
- 🔌 Compatible: Works with standard ComfyUI nodes (KSampler, VAE Decode, etc.)
- 🏃 Optional Optimizations: Triton acceleration for faster inference
- 🛠️ Model Quantization: Convert your own models to SDNQ format
Installation
Method 1: ComfyUI Manager (Recommended)
- Install ComfyUI Manager
- Search for "SDNQ" in the manager
- Click Install
- Restart ComfyUI
Method 2: Manual Installation
cd ComfyUI/custom_nodes/
git clone https://github.com/EnragedAntelope/comfyui-sdnq.git
cd comfyui-sdnq
# IMPORTANT: Install latest diffusers from git (required for Flux 2 and Z-Image)
pip install git+https://github.com/huggingface/diffusers.git
# Install other dependencies
pip install -r requirements.txt
⚠️ CRITICAL: You MUST install diffusers from git to support Flux 2, Z-Image, and other latest models. The PyPI version does not include these features yet.
Restart ComfyUI after installation.
⚠️ Critical: diffusers 0.36.0+ Required
This node pack requires diffusers 0.36.0 or higher for FLUX.2, Z-Image, video models, and multimodal support.
If you see ImportError: cannot import name 'DiffusionPipeline' or similar errors:
# Install latest diffusers from GitHub (0.36.0 not yet on PyPI)
pip install git+https://github.com/huggingface/diffusers.git
# Or upgrade when 0.36.0 is released:
pip install --upgrade diffusers>=0.36.0
Important Changes in diffusers 0.36.0:
AutoPipelineclass was removed- This node pack now uses
DiffusionPipelinewhich auto-detects all pipeline types - Supports all model architectures: T2I, I2I, I2V, T2V, multimodal
Quick Start
1. Basic Usage
- Add the SDNQ Model Loader node (under
loaders/SDNQ) - Select a model from the dropdown
- First use: Model auto-downloads from HuggingFace (cached for future use)
- Connect outputs:
MODEL→ KSamplerCLIP→ CLIP Text EncodeVAE→ VAE Decode
Defaults are optimized - just select a model and go!
2. Custom Models
Select --Custom Model-- from dropdown, then enter:
- HuggingFace repo ID:
Disty0/your-model-qint8 - Local path:
/path/to/model
3. Available Models (21+ Pre-Configured)
The dropdown includes:
- FLUX Models: FLUX.1-dev, FLUX.1-schnell, FLUX.2, FLUX.1-Krea, FLUX.1-Kontext
- Qwen Models: Qwen-Image, Qwen-Image-Lightning, Qwen-Image-Edit variants, Qwen3-VL-32B
- Other Models: Z-Image-Turbo, Chroma1-HD, ChronoEdit-14B, HunyuanImage3
- Anime/Illustration: NoobAI-XL variants
- Video: Wan2.2-I2V, Wan2.2-T2V
Most models available in uint4 quantization. Browse full collection: https://huggingface.co/collections/Disty0/sdnq
Node Reference
SDNQ Model Loader
Category: loaders/SDNQ
| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | model_selection | DROPDOWN | First model | Select pre-configured model (auto-downloads) | | custom_repo_or_path | STRING | "" | For custom models: repo ID or local path | | dtype | CHOICE | bfloat16 | Weight data type | | use_quantized_matmul | BOOLEAN | True | Triton optimization (Linux/WSL only) | | device | CHOICE | auto | Device placement |
Outputs: MODEL, CLIP, VAE (compatible with standard ComfyUI nodes)
Performance Notes
SDNQ quantization provides significant VRAM savings while maintaining quality:
- int8: Best quality/VRAM balance
- uint4: Maximum VRAM savings
Actual VRAM usage varies by:
- Model architecture (FLUX, Qwen, etc.)
- Image resolution
- Batch size
- System configuration
Check model pages on HuggingFace for specific requirements: https://huggingface.co/collections/Disty0/sdnq
Model Storage
Downloaded models are stored in:
- Location:
ComfyUI/models/diffusers/sdnq/ - Format: Standard diffusers format (works with other tools)
Models are cached automatically - download once, use forever!
Troubleshooting
"Triton not available" Warning
Triton is an optional optimization. The model will work without it, just slightly slower.
To enable Triton (Linux/WSL only):
pip install triton
Triton is not available on native Windows. Use WSL2 for Triton support.
Out of Memory Errors
- Use a more aggressive quantization (uint4 instead of int8)
- Reduce batch size or resolution
- Close other GPU applications
- Use ComfyUI's built-in VRAM management settings
Model Loading Fails
- Check internet connection (for HuggingFace models)
- Verify the repo ID is correct
- For local models, ensure the path points to the model directory (not a file)
- Check that the model is actually SDNQ-quantized (from Disty0's collection)
"Pipeline missing transformer/unet" Error
The model may not be in the expected diffusers format. SDNQ models should have a standard diffusers directory structure with model_index.json.
Integration with ComfyUI
SDNQ models are loaded via ComfyUI's native model loading system and work seamlessly with:
- KSampler and all sampling nodes
- VAE Encode/Decode
- CLIP Text Encode
- ComfyUI's built-in VRAM management
- Other compatible custom nodes
The quantized weights are preserved and the models integrate fully with ComfyUI's workflows.
Quantizing Your Own Models
SDNQ Model Quantizer Node
Convert any loaded ComfyUI model to SDNQ format:
- Load a model with any ComfyUI loader (CheckpointLoaderSimple, etc.)
- Add SDNQ Model Quantizer node (under
loaders/SDNQ) - Connect the MODEL output to the quantizer
- Configure:
- quant_type: int8, int6, uint4, or float8_e4m3fn
- output_name: Name for your quantized model
- use_svd: Enable for better quality (optional)
- Execute to quantize and save
Quantized models are saved to ComfyUI/models/diffusers/sdnq/ and can be loaded with the SDNQ Model Loader.
Development Status
Phase 1: ✅ Complete
- [x] Basic SDNQ model loading
- [x] Local and HuggingFace Hub support
- [x] ComfyUI native integration (proper MODEL, CLIP, VAE objects)
- [x] Triton optimization support
Phase 2: ✅ Complete
- [x] Model catalog with dropdown selection (21+ models)
- [x] Automatic model downloading with progress tracking
- [x] Smart caching in ComfyUI models folder
- [x] Custom model support
Phase 3: ✅ Complete
- [x] Model quantization node (convert your own models)
- [x] All latest models (FLUX.2, Qwen, Z-Image, HunyuanImage3, Video models)
- [x] ComfyUI native model loading integration
Future Enhancements:
- [ ] LoRA support with SDNQ models
- [ ] Memory usage reporting node
- [ ] Additional optimization options
Contributing
Contributions welcome! Please:
- Follow the existing code style
- Test with multiple model types (FLUX, SD3, SDXL)
- Update documentation for new features
License
Apache License 2.0 - See LICENSE
This project integrates with SDNQ by Disty0. Please respect the upstream project's license.
Credits
SDNQ - SD.Next Quantization Engine
- Author: Disty0
- Repository: https://github.com/Disty0/sdnq
- Pre-quantized models: https://huggingface.co/collections/Disty0/sdnq
This node pack provides ComfyUI integration for SDNQ. All quantization technology is developed and maintained by Disty0.