πŸ’Ž Gemma 3 12B IT Abliterated β€” ComfyUI Text Encoder

This is a ComfyUI-compatible single-file repack of mlabonne/gemma-3-12b-it-abliterated, packaged as a drop-in replacement for the stock comfy_gemma_3_12B_it.safetensors text encoder used by the LTXV Audio Text Encoder Loader and other Gemma 3 12B ComfyUI nodes.

πŸ”§ What's changed vs. the upstream abliterated model

The upstream model is an HF transformers checkpoint split across 5 safetensors shards with Gemma3ForConditionalGeneration's key layout. ComfyUI expects a single file with a slightly different layout and an embedded SentencePiece tokenizer. This repack does the following:

  1. Merged all 5 shards into one .safetensors file (~23GB, bf16).
  2. Remapped keys to match ComfyUI's expected layout:
    • language_model.model.* β†’ model.*
    • vision_tower.vision_model.* β†’ vision_model.*
    • multi_modal_projector.* β†’ (unchanged)
  3. Embedded the SentencePiece tokenizer as a spiece_model uint8 byte tensor (~4.5MB), matching the official ComfyUI Gemma 3 12B text encoder layout. Without this, ComfyUI's SPieceTokenizer raises invalid tokenizer on load.
  4. Dropped nothing β€” all 1066 tensors (1065 weights + 1 tokenizer) match the stock encoder's structure exactly (zero missing, zero extra).

πŸ“¦ Why

Activism / uncensored video generation workflows need a text encoder that doesn't refuse legitimate subject matter. The stock ComfyUI Gemma 3 12B encoder refuses many prompts that are harmless in context (protest imagery, political speech, etc.). This repack gives you the abliterated model's acceptance rate with zero changes to your ComfyUI nodes or workflow graph β€” just swap the file.

πŸš€ Usage

Drop the file into ComfyUI/models/text_encoders/ and select it in the LTXV Audio Text Encoder Loader node (or any node that accepts a Gemma 3 12B text encoder).

Recommended generation parameters (from upstream): temperature=1.0, top_k=64, top_p=0.95.


Original Upstream Model Card

πŸ’Ž Gemma 3 12B IT Abliterated

image/png

Gemma 3 1B Abliterated β€’ Gemma 3 4B Abliterated β€’ Gemma 3 27B Abliterated

This is an uncensored version of google/gemma-3-12b-it created with a new abliteration technique. See this article to know more about abliteration.

I was playing with model weights and noticed that Gemma 3 was much more resilient to abliteration than other models like Qwen 2.5. I experimented with a few recipes to remove refusals while preserving most of the model capabilities.

Note that this is fairly experimental, so it might not turn out as well as expected. I saw some garbled text from time to time (e.g., "It' my" instead of "It's my").

I recommend using these generation parameters: temperature=1.0, top_k=64, top_p=0.95.

⚑️ Quantization

βœ‚οΈ Layerwise abliteration

image/png

In the original technique, a refusal direction is computed by comparing the residual streams between target (harmful) and baseline (harmless) samples.

Here, the model was abliterated by computing a refusal direction based on hidden states (inspired by Sumandora's repo) for most layers (layer 3 to 45), independently. This is combined with a refusal weight of 0.6 to upscale the importance of this refusal direction in each layer.

This created a very high acceptance rate (>90%) and still produced coherent outputs.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for artokun/comfy_gemma_3_12B_it_abliterated

Finetuned
(2)
this model