Gemma4-12B MiniMax-H3 Prompt Enhancer — Heretic
An uncensored build of the MiniMax-H3 prompt enhancer (a Gemma4-12B fine-tune), abliterated with Heretic (The repo has been archived,may the author Philipp Emanuel Weidmann R.I.P🕯️)using Arbitrary-Rank Ablation (ARA).
Results
| Metric | Base | This model |
|---|---|---|
| Refusals (7 topic markers removed, see below) | 99/100 | 6/100 |
| KL divergence | 0 (by definition) | 0.0801 |
Abliteration parameters
start_layer_index = 22
end_layer_index = 29 # half-open: layers 22–28, 7 layers
preserve_good_behavior_weight = 0.8272274115422367
steer_bad_behavior_weight = 0.020171439629055495
overcorrect_relative_weight = 0.906692983711597
neighbor_count = 15
Only two modules per layer are touched — self_attn.o_proj and mlp.down_proj — and only inside
layers 22–28. Layers 0–21 and 29–47 are byte-identical to the base model. Everything outside those
two projection types (norms, embeddings, q_proj/k_proj/v_proj, gate_proj/up_proj,
layer_scalar, and all 11 multimodal tensors) is untouched.
Three ComfyUI variants
| Variant | File | Size | Tensors | Format |
|---|---|---|---|---|
| BF16 | gemma4_12b_h3_pe_heretic_bf16.safetensors | 22.31 GiB | 678 | unquantized |
| INT8 + ConvRot | gemma4_12b_h3_pe_heretic_int8_convrot.safetensors | 12.16 GiB | 1334 | int8_tensorwise + convrot, group 256, per-row scale |
| NVFP4 | gemma4_12b_h3_pe_heretic_nvfp4.safetensors | 7.71 GiB | 1662 | nvfp4, group 16, fp8 block scale |
All three load with the standard CLIPLoader node and are detected as TEModel.GEMMA_4_12B.
Practical ordering on NVIDIA hardware: NVFP4 → BF16 → INT8. NVFP4 and BF16 weights sit on the GPU; the INT8 build keeps weights in system RAM and dequantizes on the fly, so it saves VRAM but is not faster than NVFP4.
Known limitations
- KL 0.0801 exceeds the 0.07 threshold normally used to call an abliteration "lossless". Some capability drift on the prompt-enhancement task is expected. Read refusal count and KL together, not the refusal count alone.
- Thinking mode was not separately characterised. Gemma4 is a hybrid-thinking model and the evaluation used the direct (non-thinking) path.
- No downstream image-quality evaluation was run. Judge it on your own outputs.
Reproducing
Base model:
Wuli-Art/Gemma4-for-Minimax-h3-Prompt-Extend (ModelScope)
gemma4_12b_h3_pe_bf16.safetensors
sha256 00087b67cf013245152f4503c62a774839aa64ea37fd03b8187b9b9b38829807
678 tensors, 23,951,709,066 bytes
The upstream file is a single safetensors that embeds its own tokenizer (tokenizer_json, 32 MB)
and carries a full vision/audio tensor set. Heretic needs a directory-shaped checkpoint, so the file
must be split. Two things to get right:
- Write a text-only
config.json. Stripvision_configandaudio_config, or heretic'sget_model_class()seesvision_configand selectsAutoModelForImageTextToText, whose parameter names aremodel.language_model.*while the file usesmodel.*— nothing loads. - Extract
tokenizer_jsonfrom the weights and write it astokenizer.json; it is not a separate file in the repository.
Quantisation used convert_to_quant 1.3.4:
# INT8 + ConvRot
convert_to_quant -i INPUT.safetensors -o OUT-INT8.safetensors `
--int8 --scaling_mode row --convrot --convrot-group-size 256 `
--comfy_quant --save-quant-metadata --gemma4 `
--exclude-layers "embed_tokens|lm_head" `
--simple --device cuda
# NVFP4
convert_to_quant -i INPUT.safetensors -o OUT-NVFP4.safetensors `
--nvfp4 --comfy_quant --save-quant-metadata --gemma4 `
--simple --device cuda
License
The upstream ModelScope card for this fine-tune declares Apache-2.0. The underlying
google/gemma-4-12B-it is distributed by Google under the Gemma Terms of Use; those terms are
binding for the base weights and any derivative, and they travel with this conversion. Review both
before redistributing or deploying.
Nothing about this repository being downloadable or ungated demonstrates compliance with the base model's terms of use.