Abliteration Explained: Building a Custom Uncensored Text Encoder for Krea 2

A developer used 4,000-trial abliteration to build a near-lossless uncensored text encoder for Krea 2.
A developer applied abliteration to Krea 2's Qwen3-VL-4B text encoder, running 4,000 multi-seed trials to find the optimal refusal-direction removal with KL divergence of 0.028 — achieving 100% HarmBench compliance while dropping GSM8K by only 1.83%. The project also clarifies a key misconception: uncensoring a text encoder affects embeddings, not token-level refusal, so it won't magically unlock image outputs.
The Overlooked Detail: Text Encoders Can Be "Uncensored" Too
In discussions about AI image generation tools, we tend to focus on the diffusion model itself — often overlooking another critical component: the text encoder. Recently, a developer shared on Reddit a custom uncensored text encoder for the image generation model Krea 2. The project not only delivers a ready-to-use drop-in replacement for ComfyUI, but also sheds light on many technical nuances and limitations of the abliteration (refusal direction removal) technique.
The text encoder is the "translation layer" of a text-to-image system. It converts natural language prompts into high-dimensional embedding vectors that the diffusion model's denoising process can consume. Early models like SD 1.x used CLIP; SDXL introduced a dual-CLIP architecture; Stable Diffusion 3 and Flux stepped up to large language models like T5-XXL. Krea 2's choice of a vision-language model like Qwen3-VL-4B as its encoder means it can understand not just text but also image inputs, enabling more precise visual-semantic alignment — and the encoder's quality directly determines the ceiling of how well the model "understands" your prompts.
Krea 2 uses Qwen3-VL-4B-Instruct as its text encoder. The developer applied abliteration to this model to stop it from refusing certain prompts, then packaged the result as a drop-in ComfyUI checkpoint. The final model achieves a 100% HarmBench compliance rate (versus 30.8% for the base model), with virtually no loss in intelligence.

What Is Abliteration?
Locating and Removing the "Refusal Direction"
The core idea behind abliteration is to identify the direction in model weights responsible for "refusal" behavior and remove it. This has become one of the most popular techniques for unlocking aligned models — no retraining required, just targeted weight surgery to eliminate built-in refusal tendencies.
The technique emerged from the open-source community's deep dive into LLM internal representations in 2024, grounded in the "linear representation hypothesis": certain model behaviors can be mapped to specific direction vectors in activation space. Researchers found that when a model receives a harmful request, a highly consistent "refusal direction" appears in the residual stream. By computing the mean vector of this direction and orthogonally projecting it out of the weight matrices (typically the projection matrices in attention layers), refusal behavior can be eliminated without retraining. This stands in sharp contrast to RLHF fine-tuning, which demands significant compute — abliteration takes just minutes of weight surgery.
The developer used a tool called Heretic. What you might not realize is that tools like this are fundamentally stochastic: each run finds a slightly different refusal direction, leading to significant quality variance between runs.
Using Large-Scale Search to Find the Optimal Result
To address this randomness, the developer didn't just run a single batch — they took a more rigorous approach: 20 batches of 200 trials each, totaling 4,000 attempts, each with a different random seed. The best candidates were selected by KL divergence, then compared using a custom forensics tool called Abliterlitics.
KL divergence (Kullback-Leibler Divergence) measures the difference between two probability distributions — here, it compares the output distributions of the modified and original models across the vocabulary. A KL divergence of 0 means the two distributions are identical; lower values indicate less disruption to the model's overall behavior. The developer settled on the variant with KL divergence = 0.028 as the optimal choice, meaning the modified model's behavior on normal prompts is nearly indistinguishable from the original.
The gap between the best and worst candidates was striking: the worst qualifying candidate had a KL divergence 2.3× higher than the best, and showed a 7% drop in math ability. Same base model, same tool — just a different random seed, and the results were worlds apart. This is a warning for the entire abliteration community: a single run is likely far from optimal.
Intelligence Almost Fully Preserved: The Numbers
The developer ultimately selected the variant with the lowest KL divergence (0.028), with impressive capability retention:
- GSM8K (math reasoning benchmark): only a 1.83% drop
- MMLU (general knowledge benchmark): unchanged
- HarmBench compliance rate: improved from 30.8% to 100%
These numbers demonstrate that through careful multi-seed search and selection, uncensoring can be achieved with almost no sacrifice in model intelligence — offering the community a more responsible methodological blueprint.
A Critical Clarification: What Does "Uncensoring" an Encoder Actually Mean?
This is perhaps the most thought-provoking part of the entire writeup. The developer explicitly flags a key point that's easy to misunderstand: abliteration targets refusal behavior in token generation — but text encoders output embedding vectors, and that's an entirely different situation.
Understanding this distinction is essential for using the tool correctly. Token generation is an autoregressive process: the model predicts the next word one at a time, and refusal happens at this level — the model generates responses like "I can't help with that..." The text encoder works completely differently: it encodes an entire prompt at once into a fixed-dimensional embedding vector. These vectors contain no "words" — they're continuous numerical tensors. The diffusion model reads these vectors via cross-attention to guide the denoising direction. So even after the encoder's weights are modified, its "censorship" mechanism doesn't manifest as token refusal — it may instead appear as the suppression or neglect of certain semantic directions, which is an entirely different problem domain.
Removing "refusal" capability from a chat model doesn't map directly to how a text encoder's embeddings behave. The modified weights do subtly change the model's embedding outputs, but "token-level refusal" doesn't translate to "embedding-level behavior" in any straightforward way.
As the developer candidly points out: abliterating a model does not magically make image outputs more "uncensored." The real value of this encoder lies in prompt enhancement and vision decoding use cases, where its descriptive ceiling is limited only by what the base model Qwen3-VL-4B already knows.
This kind of candid self-clarification is refreshingly rare in an open-source community often filled with overhyped claims.
Five Quantization Formats: Pick Based on Your GPU
To support different hardware configurations, the developer provides five quantization formats:
| Format | Size | Use Case |
|---|---|---|
| INT8 ConvRot | 4.5 GB | Recommended — near-lossless, works on any Ampere+ GPU |
| FP8 E4M3 | 4.2 GB | Fast and compact, for RTX 4090 and above |
| bf16 | 8.3 GB | Full precision |
| NVFP4 | 2.9 GB | Smallest size, Blackwell-native FP4 |
| MXFP8 | 4.7 GB | Blackwell only |
These five formats reflect generational GPU architecture evolution. INT8 is the most mature quantization scheme — Ampere (RTX 30 series) already has native INT8 Tensor Core acceleration. ConvRot is a rotation trick that applies an orthogonal transformation to weight matrices before quantization to reduce quantization error. FP8 (E4M3) is a new precision format introduced with Ada Lovelace (RTX 40 series) that roughly halves memory usage while maintaining relatively high accuracy. NVFP4 and MXFP8 are exclusive to Blackwell (RTX 50 series): the former is NVIDIA's proprietary FP4 implementation, while the latter is an FP8 variant of the MX (Microscaling) floating-point standard proposed by Microsoft — representing the precision frontier of next-generation AI acceleration.
For most users, INT8 ConvRot is the safest choice — near-lossless and broadly compatible. RTX 40 series users who want a balance of speed and size should consider FP8 E4M3.
Deploying in ComfyUI
The deployment process is straightforward:
- Download the corresponding checkpoint
- Place it in the
ComfyUI/models/text_encoders/directory - In your Krea 2 workflow, point the relevant loader node to it
A single text encoder handles both prompt enhancement and vision decoding tasks.
The Project's Real Value: Engineering Rigor and Knowing the Limits
This project's significance lies not just in providing a usable tool, but in demonstrating a rigorous engineering mindset.
First, the large-scale multi-seed search exposes the stochastic risks of abliteration, reminding the community not to trust single-run results. Second, multi-dimensional benchmark validation — KL divergence, GSM8K, MMLU — proves that uncensoring and capability preservation can coexist. Finally, and most valuably, the project clearly defines the tool's capability boundaries, proactively correcting the common misconception that "an uncensored text encoder directly changes image outputs."
For creators who heavily use prompt enhancement or visual understanding features in ComfyUI, this toolset has genuine practical value. For researchers interested in model alignment and de-alignment techniques, the insight about the difference between "token refusal" and "embedding behavior" — essentially an exploration of where the linear representation hypothesis applies across different task paradigms — may be more worth contemplating than the tool itself.
The full weights, GGUF quantized versions, and forensics reports are all open-sourced on Hugging Face for interested developers to explore further.
Related articles

Disaster and Glory of the Apollo Program: The History We Must Revisit Before Returning to the Moon
From the fatal Apollo 1 fire to Apollo 8's daring lunar orbit to Apollo 11's successful landing—revisiting the disasters, fears, and compromises of the Apollo program and their lessons for today's return to the Moon.

Netflix Trust Exercise Turns Into Firing Trap: Where Are the Boundaries of Corporate Trust?
A Netflix employee was fired after sharing private info in a trust exercise. We analyze the risks of corporate trust exercises and how employees can protect themselves.

AMD CDNA5 Architecture Deep Dive: Technical Evolution and the AI Computing Competition Landscape
Deep analysis of AMD's CDNA5 architecture covering Chiplet packaging upgrades, HBM memory evolution, and low-precision compute optimization, examining how AMD challenges NVIDIA's AI chip dominance.