Repository navigation
[Quantization] Add support for Comfy-Kitchen / Comfy-Quants - #14747
PrakshaaleJain wants to merge 35 commits into
Conversation
a99b253 to
e9bca91
Compare
|
Hi @DN6, please have a review for the PR. |
|
Hi @DN6, I have made the changes as per the reviews. Please help it to get merged. |
|
Hi @DN6, I have made changes as your latest reviews and help me merge this PR. |
|
@PrakshaaleJain have you tested loading with a real checkpoint? After going through the proposed design again, I do not believe it will work. |
|
Yeah, I haven't check with a real checkpoint yet. I 'll setup a test with an actual checkpoint to confirm all work as expected. I'll push an update once I've verified it. |
|
@PrakshaaleJain Gentle ping. |
|
wip |
|
Hi @DN6, Key features and fixes from the previous implementation:
|
|
HI @DN6, please have a review of the changes for Comfy-Quant. |
|
Are you able to post some sample generations and test code? |
Yes will do that. No Problem. |
|
Hi @DN6, I hope you see this and help me on getting the PR merged. |
|
@PrakshaaleJain Other people have requested that you post sample testing code and generation results, but I do not see anything here. I am rather interested in this feature being implemented myself, so I decided to pull this into a local branch and test it myself.
Immediately, these 2 Z Image Turbo quants, the first being int8_convrot and the latter being nvfp4, both fail to even load. The nvfp4 quant is technically not your fault since the failing part is not in your code, but still your claims made in the PR are definitely unverified.
I plan to test this with Flux.2 Klein 4B FP8 and an FP8 quant of ZIT, will update soon. |
|
This fp8 quant of ZIT also fails. This quant also fails. |
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.