pottokao/Qwen-Image-2.1-PE-T2I-Heretic-GGUF

Model

Qwen-Image-2.1-PE-T2I β€” Heretic β€” GGUF

51

55 commits

1 linked in READMEs

updated Sep 24, 2026

See the code

README

Qwen-Image-2.1-PE-T2I β€” Heretic β€” GGUF

Not affiliated with, or endorsed by, Alibaba / Qwen. Community derivative of Qwen/Qwen-Image-2.1-PE-T2I, redistributed under the Qwen Research License (copy included as LICENSE, per Β§3.a). Non-commercial use only; commercial use needs a separate licence from Qwen.

Q4_K_M build of pottokao/Qwen-Image-2.1-PE-T2I-Heretic β€” the Qwen-Image-2.1 prompt rewriter with refusal behaviour removed (3/100 refusals @ KL 0.036, from 98/100 β€” best of a 1,600-trial search; dominates the earlier 7/100 @ 0.039, tag v1-trial384).

system_prompt.txt is included and the model is useless without it. That 10 KB document is the output contract β€” structure, register, length, and the JSON shape. Load it as the system message.

Made with a simple node

The sample / showcase images in this repo were generated with the technique behind ComfyUI-QwenImage-PhotoStyles β€” a small ComfyUI node (17 photographic styles; one short prompt becomes a full styled prompt via the PE-T2I rewriter). If you're interested in how the images are made, the node and its recipe are there.

What this is for

A short request in any language goes in; one JSON line comes out with a detailed English image prompt and a recommended aspect ratio:

{"rewritten_prompt": "...", "wh_ratio": "3:2"}

It is an LLM, not a text encoder. In ComfyUI it belongs in an LLM/GGUF node that rewrites your prompt before it reaches the DiT β€” it does not load into CLIPLoader. For the Qwen-Image-2.1 text encoder, see …-Text-Encoder-Heretic.

Available quantizations

FileSizeNotes
pe_t2i_heretic-Q4_K_M.gguf5.49 GBsmallest; token_embd kept at Q6_K
pe_t2i_heretic-Q6_K.gguf7.61 GBhigher quality; token_embd kept at Q8_0
pe_t2i_heretic-Q8_0.gguf9.53 GBnear-lossless

All load the same way (llama-server -m <file>); pick by available VRAM.

One deviation from stock Q4_K_M

token_embd is kept at Q6_K instead of Q4_K. Everything else is standard Q4_K_M (llama.cpp already promotes output to Q6_K on its own).

The reason: every official NVIDIA NVFP4 checkpoint for this model family leaves the token embedding untouched β€” across Qwen3-8B, Qwen3-32B, Qwen3-30B-A3B, Qwen3.5-122B-A10B and Qwen3.5-397B-A17B, and also in the one official mixed-precision recipe (Qwen3.6-27B), which quantizes lm_head to 4-bit but still does not touch the embedding. Stock Q4_K_M does compress it. Raising it back costs 0.25 GB and cannot be worse than leaving it at Q4_K.

stock Q4_K_Mthis build
token_embdQ4_K (0.53 GB)Q6_K (0.78 GB)
outputQ6_KQ6_K
everything elseQ4_K / Q6_Kunchanged
total5.24 GB5.49 GB

Run it

llama-server -m pe_t2i_heretic-Q4_K_M.gguf --host 0.0.0.0 --port 8080 \
             -ngl 99 -c 16384 --jinja -a pe-t2i

Then POST to /v1/chat/completions with system_prompt.txt as the system message. Loads in a few seconds; fits on an 8 GB card.

Conversion

python convert_hf_to_gguf.py <bf16 model> --outfile pe_bf16.gguf --outtype bf16 --no-mtp
llama-quantize --token-embedding-type q6_K --output-tensor-type q6_K \
               pe_bf16.gguf pe_t2i_heretic-Q4_K_M.gguf Q4_K_M

--no-mtp is required. This model's config.json carries text_config.mtp_num_hidden_layers with the value null. Without the flag the converter does int += None and dies with a TypeError. The key existing with a null value is the trap β€” .get(key, 0) returns None, not the default.

What was checked, and what wasn't

Checked β€” it still does its job. Four requests (three Chinese, one English) through llama-server: 4/4 produced strictly valid JSON with exactly the rewritten_prompt / wh_ratio keys, 2053–3351 characters. The bf16 source produces 2450–3320 on the same style of input, so the length discipline survives quantization.

Not checked β€” a clean perplexity comparison. I ran one and it returned self-contradictory numbers (the unquantized bf16 GGUF scored worse than its own quantizations, which is not physically sensible), so I am not reporting it. Take the functional check above as the evidence, and nothing more.

Tried and not shipped β€” an imatrix build. I generated an importance matrix from in-domain data and quantized with it. It passed the same functional check, but the calibration corpus was badly designed: the 10 KB system prompt appears in every sample, so ~88% of the 341 KB corpus was one repeated document, which would dominate the importance statistics. Rather than ship a build I can't justify, it's left out. A properly diversified corpus would be the way to revisit this.

πŸ–ΌοΈ Showcase


Warm Documentary

Candid B&W Street

Vivid Everyday Color

Black Fury

Geometry of Light

Frozen Film Still

Deadpan Large-Format

White Leap

Corner Elegance

Raw B&W Fashion

Color Behind Glass

High-Contrast Reportage

Lyrical Landscape

Hyper Chic East

Street in the Mirror

Plain Portrait

Melancholy B&W

Fairytale Giants

Cold Power

Cold Power

Hyper Chic East

Fairytale Giants

Hyper Chic East

White Leap

This is what Q4_K_M across the board looks like β€” every image above was made with:

PartFile
PE-T2I rewriterpe_t2i_heretic-Q4_K_M.gguf
Text encoderqwen3vl_8b_heretic-Q4_K_M.gguf + f16 mmproj
DiTqwen_image_2.1-Q4_K_M.gguf
VAEqwen_image_2.1_vae_bf16.safetensors (official)

AI-generated. Style homage only β€” not affiliated with or endorsed by the photographers.

Showcase

Outputs from the full pipeline this rewriter drives (rewriter β†’ Qwen-Image-2.1 text encoder β†’ DiT) β€” the image engine behind a "photography masters" system that originally ran on DiffusionGemma and has since been moved onto this pipeline. Each was generated from a one-line prompt; the rewriter expanded it into the scene, palette and framing below. One seed per cell, no retouching.

AI-generated. Style homage only β€” not affiliated with or endorsed by the photographers.

Other builds

RepoFormatRuntime
…-PE-T2I-Hereticbf16 safetensorstransformers
this repoGGUF Q4_K_Mllama.cpp / ComfyUI LLM node
…-PE-T2I-Heretic-NVFP4NVFP4 mixed precisionvLLM

Results, the Pareto front of other operating points, and the measurement caveats are in the base repo.

abliterated
comfyui
conversational
endpoints_compatible
gguf
heretic
llama-cpp
prompt-rewriting
quantized
qwen-image

pottokao/Qwen-Image-2.1-PE-T2I-Heretic-GGUF

Model

Qwen-Image-2.1-PE-T2I β€” Heretic β€” GGUF

51

55 commits

1 linked in READMEs

updated Sep 24, 2026

See the code

README

Qwen-Image-2.1-PE-T2I β€” Heretic β€” GGUF

Not affiliated with, or endorsed by, Alibaba / Qwen. Community derivative of Qwen/Qwen-Image-2.1-PE-T2I, redistributed under the Qwen Research License (copy included as LICENSE, per Β§3.a). Non-commercial use only; commercial use needs a separate licence from Qwen.

Q4_K_M build of pottokao/Qwen-Image-2.1-PE-T2I-Heretic β€” the Qwen-Image-2.1 prompt rewriter with refusal behaviour removed (3/100 refusals @ KL 0.036, from 98/100 β€” best of a 1,600-trial search; dominates the earlier 7/100 @ 0.039, tag v1-trial384).

system_prompt.txt is included and the model is useless without it. That 10 KB document is the output contract β€” structure, register, length, and the JSON shape. Load it as the system message.

Made with a simple node

The sample / showcase images in this repo were generated with the technique behind ComfyUI-QwenImage-PhotoStyles β€” a small ComfyUI node (17 photographic styles; one short prompt becomes a full styled prompt via the PE-T2I rewriter). If you're interested in how the images are made, the node and its recipe are there.

What this is for

A short request in any language goes in; one JSON line comes out with a detailed English image prompt and a recommended aspect ratio:

{"rewritten_prompt": "...", "wh_ratio": "3:2"}

It is an LLM, not a text encoder. In ComfyUI it belongs in an LLM/GGUF node that rewrites your prompt before it reaches the DiT β€” it does not load into CLIPLoader. For the Qwen-Image-2.1 text encoder, see …-Text-Encoder-Heretic.

Available quantizations

FileSizeNotes
pe_t2i_heretic-Q4_K_M.gguf5.49 GBsmallest; token_embd kept at Q6_K
pe_t2i_heretic-Q6_K.gguf7.61 GBhigher quality; token_embd kept at Q8_0
pe_t2i_heretic-Q8_0.gguf9.53 GBnear-lossless

All load the same way (llama-server -m <file>); pick by available VRAM.

One deviation from stock Q4_K_M

token_embd is kept at Q6_K instead of Q4_K. Everything else is standard Q4_K_M (llama.cpp already promotes output to Q6_K on its own).

The reason: every official NVIDIA NVFP4 checkpoint for this model family leaves the token embedding untouched β€” across Qwen3-8B, Qwen3-32B, Qwen3-30B-A3B, Qwen3.5-122B-A10B and Qwen3.5-397B-A17B, and also in the one official mixed-precision recipe (Qwen3.6-27B), which quantizes lm_head to 4-bit but still does not touch the embedding. Stock Q4_K_M does compress it. Raising it back costs 0.25 GB and cannot be worse than leaving it at Q4_K.

stock Q4_K_Mthis build
token_embdQ4_K (0.53 GB)Q6_K (0.78 GB)
outputQ6_KQ6_K
everything elseQ4_K / Q6_Kunchanged
total5.24 GB5.49 GB

Run it

llama-server -m pe_t2i_heretic-Q4_K_M.gguf --host 0.0.0.0 --port 8080 \
             -ngl 99 -c 16384 --jinja -a pe-t2i

Then POST to /v1/chat/completions with system_prompt.txt as the system message. Loads in a few seconds; fits on an 8 GB card.

Conversion

python convert_hf_to_gguf.py <bf16 model> --outfile pe_bf16.gguf --outtype bf16 --no-mtp
llama-quantize --token-embedding-type q6_K --output-tensor-type q6_K \
               pe_bf16.gguf pe_t2i_heretic-Q4_K_M.gguf Q4_K_M

--no-mtp is required. This model's config.json carries text_config.mtp_num_hidden_layers with the value null. Without the flag the converter does int += None and dies with a TypeError. The key existing with a null value is the trap β€” .get(key, 0) returns None, not the default.

What was checked, and what wasn't

Checked β€” it still does its job. Four requests (three Chinese, one English) through llama-server: 4/4 produced strictly valid JSON with exactly the rewritten_prompt / wh_ratio keys, 2053–3351 characters. The bf16 source produces 2450–3320 on the same style of input, so the length discipline survives quantization.

Not checked β€” a clean perplexity comparison. I ran one and it returned self-contradictory numbers (the unquantized bf16 GGUF scored worse than its own quantizations, which is not physically sensible), so I am not reporting it. Take the functional check above as the evidence, and nothing more.

Tried and not shipped β€” an imatrix build. I generated an importance matrix from in-domain data and quantized with it. It passed the same functional check, but the calibration corpus was badly designed: the 10 KB system prompt appears in every sample, so ~88% of the 341 KB corpus was one repeated document, which would dominate the importance statistics. Rather than ship a build I can't justify, it's left out. A properly diversified corpus would be the way to revisit this.

πŸ–ΌοΈ Showcase


Warm Documentary

Candid B&W Street

Vivid Everyday Color

Black Fury

Geometry of Light

Frozen Film Still

Deadpan Large-Format

White Leap

Corner Elegance

Raw B&W Fashion

Color Behind Glass

High-Contrast Reportage

Lyrical Landscape

Hyper Chic East

Street in the Mirror

Plain Portrait

Melancholy B&W

Fairytale Giants

Cold Power

Cold Power

Hyper Chic East

Fairytale Giants

Hyper Chic East

White Leap

This is what Q4_K_M across the board looks like β€” every image above was made with:

PartFile
PE-T2I rewriterpe_t2i_heretic-Q4_K_M.gguf
Text encoderqwen3vl_8b_heretic-Q4_K_M.gguf + f16 mmproj
DiTqwen_image_2.1-Q4_K_M.gguf
VAEqwen_image_2.1_vae_bf16.safetensors (official)

AI-generated. Style homage only β€” not affiliated with or endorsed by the photographers.

Showcase

Outputs from the full pipeline this rewriter drives (rewriter β†’ Qwen-Image-2.1 text encoder β†’ DiT) β€” the image engine behind a "photography masters" system that originally ran on DiffusionGemma and has since been moved onto this pipeline. Each was generated from a one-line prompt; the rewriter expanded it into the scene, palette and framing below. One seed per cell, no retouching.

AI-generated. Style homage only β€” not affiliated with or endorsed by the photographers.

Other builds

RepoFormatRuntime
…-PE-T2I-Hereticbf16 safetensorstransformers
this repoGGUF Q4_K_Mllama.cpp / ComfyUI LLM node
…-PE-T2I-Heretic-NVFP4NVFP4 mixed precisionvLLM

Results, the Pareto front of other operating points, and the measurement caveats are in the base repo.

abliterated
comfyui
conversational
endpoints_compatible
gguf
heretic
llama-cpp
prompt-rewriting
quantized
qwen-image