Skip to page content
SAVRN
Search Plan a project

Open-weight model

Qwen3-4B-Text-Encoder-DHQ-GGUF

by Pottokao pottokao/Qwen3-4B-Text-Encoder-DHQ-GGUF

Qwen3-4B-Text-Encoder-DHQ-GGUF is an open-weight model from Pottokao, released under Apache License 2.0. Its published files total 5.8 GB.

Two 2.9 GB GGUFs of the Qwen3-4B text encoder, quantized with DHQ, a per-tensor mixed-precision allocation that is scored by the diffusion model rather than by next-token KL.

Parameters—
Context—
Weights5.8 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Pottokao, published under apache-2.0, revision 1c8d3be84c33.

Two 2.9 GB GGUFs of the Qwen3-4B text encoder, quantized with DHQ, a per-tensor mixed-precision allocation that is scored by the diffusion model rather than by next-token KL. DHQ files are quantized for use as a diffusion model's text encoder: each tensor's precision is chosen by how much its quantization error changes what the target DiT reads (measured through the DiT's own text-input stage), not by next-token loss. They stay normal LLM GGUFs, so the same file can still write or rewrite prompts: where a model is also used as a prompt enhancer (Z-Image-Engineer-V6, the heretic Qwen3-VL-8B), every file is also checked for that (the PE column) and the tables show where it gets worse. We also…

Read Pottokao's full model card

Qwen3-4B text encoder GGUF, quantized by what the DiT sees (DHQ)

Two 2.9 GB GGUFs of the Qwen3-4B text encoder, quantized with DHQ, a per-tensor mixed-precision allocation that is scored by the diffusion model rather than by next-token KL.

File Source Size For
qwen3_4b_dhq_2p9.gguf Qwen/Qwen3-4B 2.91 GB Z-Image and FLUX.2 [klein] 4B text encoder
zimage_engineer_v6_dhq_2p9.gguf BennyDaBall/Z-Image-Engineer-V6 2.91 GB Z-Image text encoder that also writes prompts (one file for both jobs)

About the DHQ series

DHQ files are quantized for use as a diffusion model's text encoder: each tensor's precision is chosen by how much its quantization error changes what the target DiT reads (measured through the DiT's own text-input stage), not by next-token loss. They stay normal LLM GGUFs, so the same file can still write or rewrite prompts: where a model is also used as a prompt enhancer (Z-Image-Engineer-V6, the heretic Qwen3-VL-8B), every file is also checked for that (the PE column) and the tables show where it gets worse.

DHQ repos: Qwen-Image-2.1 · Ideogram 4 · Z-Image-Engineer-V6 · Qwen3-4B (Z-Image / FLUX.2 klein 4B)

We also built Dual-Head Dragon, a ComfyUI node that runs one GGUF as both the text encoder and the prompt enhancer (llama.cpp inside). It is still in testing and not released yet, including its LoRA support (separate LoRAs for the encoding and the rewriting head) and DFlash speculative decoding for faster rewriting. The files here work without it (see How to load).

Why

A text encoder feeding a DiT is judged by the hidden states the DiT reads (Z-Image reads layer 34; klein reads layers 8/17/26), not by the next token. Standard quants (llama.cpp Q4_K_M, Unsloth Dynamic) spend bits based on LLM output. DHQ measures each tensor's damage through the DiT's input layer and spends bits where the DiT feels it.

Rules for these files: every tensor is at least Q4_K; the size budget is 2.9 GB. Mix: Q4_K / Q5_K / Q6_K / Q8_0 per tensor. The full per-layer table (q/k/v/o/gate/up/down for every layer) is in GRIDS.md.

Measured error (real GGUFs, lower is better)

Metric: relative error of the text-encoder output after the DiT's input layer, compared with BF16, averaged over 18 prompts (12 long, 6 short). All files run through llama.cpp's real kernels.

Qwen3-4B

File Size Z-Image klein 4B
Q8_0 4.28 GB 2.1% 1.4%
DHQ 2.9 (this repo) 2.91 GB 6.0% 4.0%
Unsloth UD-Q5_K_XL type map, same imatrix 2.90 GB 6.8% 5.0%
Q4_K_M (imatrix) 2.50 GB 11.5% 8.3%

Z-Image-Engineer-V6

File Size Z-Image
DHQ 2.9 (this repo) 2.91 GB 4.5%
Q4_K_M 2.50 GB 10.6%

The V6 file uses an importance matrix computed on V6 itself (same calibration text as the Qwen3-4B file). On 36 held-out prompts never used to pick the mix it scores 4.4%.

Formats

Both files use only K-quant types (Q4_K / Q5_K / Q6_K / Q8_0 per tensor), so they decode fast everywhere (GPU, CPU, Metal, Vulkan, and ComfyUI-GGUF on the GPU). There are no IQ files in this repo.

Usage

ComfyUI (needs ComfyUI-GGUF): put the file in models/text_encoders/, load it with CLIPLoaderGGUF, type lumina2 for Z-Image or flux2 for FLUX.2 [klein] 4B. Everything else is the stock workflow.

llama.cpp / LM Studio: both are standard qwen3 GGUFs. The V6 file can write Z-Image prompts the same way the original V6 does.

Reproducibility

recipes/ has one recipe per file: source repo and revision, llama.cpp commit, importance matrix (sha256), and the type of every tensor as built. Rebuilding from a recipe gives a bit-identical file (checked).

sha256

1be4aa21207e48ac7a06a9b5a6656d3aa8b612769a3cbcf9b6960c173860ab42  qwen3_4b_dhq_2p9.gguf
81125bf274d28b0481984ac0da2bacbf9d7505e58d34962c0e6b0da886d48762  zimage_engineer_v6_dhq_2p9.gguf

License

Apache-2.0, same as both source models. Credit to the Qwen team for Qwen3-4B and to BennyDaBall for Z-Image-Engineer-V6.

Identity and Version

Repository
pottokao/Qwen3-4B-Text-Encoder-DHQ-GGUF
Publisher
Pottokao
Task
Not stated by the source
Modality
Other
Library
Not stated by the source
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
1c8d3be84c335ff7887c342fd2c87b7ebc0f048f
First published
2026-09-27
Last updated
2026-09-28

Files and Weights

10 files, 5.8 GB in total. The weights are 2 files totalling 5.8 GB in gguf.

Weights2 files · 5.8 GB
Configuration2 files · 69.7 KB
Documentation5 files · 28.9 KB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
qwen3_4b_dhq_2p9.ggufWeights2.9 GB 1be4aa21207e
zimage_engineer_v6_dhq_2p9.ggufWeights2.9 GB 81125bf274d2
recipes/qwen3_4b_dhq_2p9.recipe.jsonConfiguration35.1 KB —
recipes/zimage_engineer_v6_dhq_2p9.recipe.jsonConfiguration34.6 KB —
GRIDS.mdDocumentation3.8 KB —
LICENSEDocumentation11.4 KB —
README.mdDocumentation4.7 KB —
recipes/qwen3_4b_dhq_2p9.recipe.mdDocumentation4.6 KB —
recipes/zimage_engineer_v6_dhq_2p9.recipe.mdDocumentation4.5 KB —
.gitattributesRepository1.6 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
5.8 GB
Download from Pottokao

Released by Pottokao through its official repository on Hugging Face. Read the license.

Built From

  • Derived from BennyDaBall/Z-Image-Engineer-V6
  • Quantized from BennyDaBall/Z-Image-Engineer-V6

Memory Requirements

PrecisionWeights in memory
As published5.8 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About Qwen3-4B-Text-Encoder-DHQ-GGUF

Can I use Qwen3-4B-Text-Encoder-DHQ-GGUF commercially?

Yes. Qwen3-4B-Text-Encoder-DHQ-GGUF is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.