CoolFace
Modelpublic

QuantFunc/Qwen-Image-Layered-Series

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
2likes6downloads
Model Card

QuantFunc

<div align="center" style="margin-top: 50px;"> <img src="https://raw.githubusercontent.com/RealJonathanYip/ComfyUI-QuantFunc/main/assets/logo.webp" width="300" alt="Logo"> </div>

<p align="center"> ๐Ÿค— <a href="https://huggingface.co/QuantFunc">Hugging Face</a> &nbsp;|&nbsp; ๐Ÿค– <a href="https://www.modelscope.cn/profile/QuantFunc">ModelScope</a> &nbsp;|&nbsp; ๐Ÿ’ป <a href="https://github.com/RealJonathanYip/ComfyUI-QuantFunc">GitHub</a> &nbsp;|&nbsp; ๐Ÿ’ฌ <a href="#wechat">WeChat (ๅพฎไฟก)</a> &nbsp;|&nbsp; ๐ŸŽฎ <a href="https://discord.gg/jCp9TpFWcn">Discord</a> </p>

Qwen-Image-Layered-Series

โš ๏ธ Config-only repository โ€” no model weights. This repo contains only QuantFunc per-layer precision configs for Qwen-Image-Layered (RGBA layer decomposition). It does not contain, mirror, or redistribute any model weights. You bring your own official `Qwen/Qwen-Image-Layered`; these configs only tell the QuantFunc engine how to quantize it at load time, on your own machine.

Powered by the [QuantFunc ComfyUI plugin](https://github.com/RealJonathanYip/ComfyUI-QuantFunc) โ€” the fastest diffusion inference engine:

  • โ€”๐Ÿš€ 2xโ€“11x speedup over standard BF16/FP16 Python pipelines.
  • โ€”โš™๏ธ Native C++/CUDA (libquantfunc.so / quantfunc.dll), zero Python model dependencies.
  • โ€”๐Ÿงฉ Universal format adapter โ€” loads diffusers / BFL / HF layouts directly, no manual conversion.
  • โ€”๐ŸŸข Full GPU coverage โ€” RTX 20/30/40/50 ยท A100/H100/H200/B100/B200 (CUDA 12 & 13); native FP4 on Blackwell.

๐Ÿ‘‰ Install the plugin: https://github.com/RealJonathanYip/ComfyUI-QuantFunc

What this repository provides

Just the precision configs โ€” no weights:

Qwen-Image-Layered-Series/
โ”œโ”€โ”€ config.json                        # = 50x-below INT4 map (HF download-counter query file)
โ””โ”€โ”€ precision-config/
    โ”œโ”€โ”€ 50x-above-fp4-sample.json      # NVFP4 (FP4 weights, af8wf4 MLP) โ€” RTX 50 / SM120+
    โ””โ”€โ”€ 50x-below-int4-sample.json     # INT4 per-group-128 โ€” all SMs (robust fallback)

We deliberately do not host Qwen-Image-Layered weights. The QuantFunc Lighting backend does runtime quantization: you load the official weights and they are quantized in-memory at load, so no pre-quantized checkpoint is ever distributed.

How to use

  1. 1.Obtain the official model yourself โ€” `Qwen/Qwen-Image-Layered` (diffusers layout). Follow Qwen's distribution channels and license.
  2. 2.Install the QuantFunc ComfyUI plugin: https://github.com/RealJonathanYip/ComfyUI-QuantFunc
  3. 3.Load the official model through the Build Pipeline node (universal format adapter).
  4. 4.Precision config โ€” leave the node on `auto detect` (it recognizes Qwen-Image-Layered and applies the right map automatically: NVFP4 on RTX 50 / SM120+, INT4 otherwise), or point it at a file manually.

Precision configs

Two GPU tiers (the auto-detect picks by SM):

FileTarget GPUScheme
50x-above-fp4-sample.jsonRTX 50 / SM120+NVFP4 (FP4 e2m1 weights); FP8 activations on the MLP only (af8wf4), attention stays W4A4
50x-below-int4-sample.jsonRTX 20/30/40 + datacenterINT4 per-group-128 (AUTO_4 โ†’ INT4 on all SMs); robust, fully coherent at any SM

Why the MLP is `af8wf4` on the NVFP4 map: use_additional_t_cond + layer3d modulation make the MLP input activations large enough to saturate the FP4-activation per-16 FP8 (e4m3 max 448) microscale โ†’ green-noise background. FP8 activation (per-token FP16 act-scale) on the MLP removes it; attention tolerates FP4 activation and stays on the fast W4A4 path. This differs from the base Qwen-Image NVFP4 map by exactly one layer (the MLP up-projection net.0.proj). In both maps the img_mod/txt_mod modulation GEMMs stay INT8.

โš ๏ธ Companion settings REQUIRED for coherence (not part of the precision map)

  • โ€”base scheduler (configs/qwen-image-base-scheduler.json)
  • โ€”num_inference_steps = 50
  • โ€”true_cfg_scale = 4.0
  • โ€”non-empty negative_prompt
  • โ€”a real RGBA composite input image
  • โ€”resolution 640
NVFP4 (50x-above) is SM120+ only (FP4 is native sm_120a, never PTX-JIT). On older GPUs use the INT4 map.

Legal / Attribution

  • โ€”This repository distributes only the QuantFunc precision-config JSON โ€” our own work, Apache-2.0.
  • โ€”It contains no Qwen weights and is not affiliated with, nor endorsed by, the Qwen team.
  • โ€”You are solely responsible for obtaining the official model and complying with its license and terms of use.

Community

  • โ€”๐ŸŽฎ Discord server
  • โ€”๐Ÿ’ฌ Scan the QR code below to join our WeChat group:

<div align="center" id="wechat"> <img src="https://raw.githubusercontent.com/RealJonathanYip/ComfyUI-QuantFunc/main/assets/WeChat.jpg" alt="WeChat Group" width="300"> </div>