[Quantization] Add support for Comfy-Kitchen / Comfy-Quants - #14747
Open
PrakshaaleJain wants to merge 10 commits into
Open
[Quantization] Add support for Comfy-Kitchen / Comfy-Quants#14747PrakshaaleJain wants to merge 10 commits into
PrakshaaleJain wants to merge 10 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds support for the Comfy Quant quantization toolkit by integrating its inference engine, Comfy-Kitchen, directly into Diffusers library.
Key additions:
ComfyQuantConfigandComfyQuantizerto handle wrapping of tensors.create_quantized_paramand wraps them viaQuantizedTensor.from_floatto dispatch to Comfy-Kitchen's optimized GPU kernels.fp8,int8,mxfp8,nvfp4,int4_svd,int4_awq).tests/quantization/comfy_quant/.Fixes #14705
Before submitting
self-reviewskill on the diff?AI Agent Self-Review Notes
Agent: Antigravity (Google DeepMind)
Review Focus: Diffusers Quantization Standards & Guidelines
ComfyQuantizerrelies onis_comfy_kitchen_available(). If the backend is not installed, Diffusers will safely fall back to standard behavior or fail gracefully ifComfyQuantConfigis passed explicitly without the toolkit.make style && make fix-copies.utils/check_dummies.pysuccessfully generateddummy_comfy_kitchen_objects.pyand correctly registered the imports in `diffusers/__inittests/quantization/comfy_quant/test_comfy_quant.py. Tests cover both valid format wrapping (FP8mapping toTensorCoreFP8Layout) and error handling for unsupported formats. Tests ran locally and passed with 100% success.