Skip to content

Qwen-Image-2.1 Uncensored: Run Unrestricted ComfyUI with GGUF & Heretic

Master running Qwen-Image-2.1 Uncensored in ComfyUI using GGUF DiT and Heretic Text Encoder. Bypass refusal filters and optimize VRAM on RTX and Apple Silicon.

Hoang Yell
Hoang Yell
10 min read
Tiếng Việt
Qwen-Image-2.1 Uncensored: Run Unrestricted ComfyUI with GGUF & Heretic

Nothing drains creative momentum faster than paying $30 a month for commercial cloud AI generators only to trigger a harsh red warning: “Your prompt violates safety policy” when rendering a classical anatomical study or a gothic surrealist concept. Corporate morality filters reduce powerful diffusion models into condescending black boxes.

When Alibaba released Qwen-Image-2.1, computer graphics researchers praised its text-following precision and composition fidelity. However, true hardware ownership only arrived when open-source hackers extracted and packaged the Uncensored GGUF diffusion weights alongside the refusal-ablated Heretic text encoder for ComfyUI.


TL;DR

Quick Answer Box (Google Search Featured Snippet): What is Qwen-Image-2.1 Uncensored for ComfyUI? It is an open-source local image generation workflow combining GGUF-quantized Qwen-Image-2.1 diffusion weights with the refusal-ablated Heretic text encoder. This architecture eliminates cloud morality guardrails, runs locally on consumer NVIDIA GPUs and Apple Silicon with as little as 8GB VRAM, and preserves total data privacy.

  • Dual-Layer Freedom: The GGUF DiT eliminates application-level safety checkers, while the Heretic text encoder surgically removes refusal vectors from latent token conditioning.
  • Smart Memory Offloading: Hosting the quantized Q4_K_M DiT in GPU VRAM while offloading the text encoder to System RAM prevents out-of-memory errors on 8GB - 12GB graphics cards.
  • Hardware-Specific Encoders: Dedicated formats include NVFP4 for RTX 50 series, W4A8 for RTX 30/40 series, and GGUF for Apple Silicon unified memory.
  • Version Compatibility: Requires ComfyUI version 0.36.0 or later to recognize the native TextEncodeQwenImage21 node structure.
  • Core Repositories: Upstream weights available at abenzerps/Qwen-Image-2.1-GGUF and text encoder weights at pottokao/Qwen-Image-2.1-Text-Encoder-Heretic.

Beginner Map

Standard image generation resembles a brilliant master painter shadowed by an anxious corporate manager who snips canvas threads whenever an unconventional word appears. The Qwen-Image Uncensored stack removes the manager with a laser scalpel, leaving a direct connection between your raw prompt text and the underlying diffusion canvas.


Part 1: Foundations

In early Stable Diffusion setups, running an uncensored pipeline was simple: developers commented out the SafetyChecker line in the Python script. In modern generative models where foundation-scale vision-language models act as text encoders, censorship operates on two distinct architectural layers.

The first layer is the DiT (Diffusion Transformer - a diffusion neural network operating on visual patches). This component iteratively denoises latent variables into coherent visual structures. The second layer is the Text Encoder (a natural language processing model translating text strings into mathematical conditioning vectors), which in Qwen-Image-2.1 is powered by Qwen3-VL-8B-Instruct.

Because Qwen3-VL-8B-Instruct underwent extensive reinforcement learning alignment, it inherently refuses to generate conditioning embeddings for edgy artistic themes, human anatomy, or dark fantasy prompts. Even if your diffusion model contains zero safety filters, a refusing text encoder simply passes empty tensors to the sampling loop, producing solid gray noise or failing entirely.

Technical Term 3-6 Word Plain Explanation
DiT (Diffusion Transformer) Neural network turning noise to images
VRAM (Video RAM) Ultra-fast graphics card memory
Text Encoder Translates prompt words into numbers
Abliteration (Directional Ablation) Surgical removal of refusal vectors
GGUF (Quantized Format) Compressed model format saving memory
VAE (Variational Autoencoder) Converts latents into viewable pixels

Developer Pottokao resolved this bottleneck using the Heretic ablation framework. Rather than retraining all eight billion parameters, directional ablation locates the precise linear subspace responsible for refusal behavior and subtracts it from the weight matrices. The resulting KL divergence (a mathematical measurement of knowledge divergence from baseline) is merely 0.0220, preserving complex spatial reasoning while slashing prompt refusals from 100% down to 5%.


Part 2: Investigation

Running this workflow locally does not demand a datacenter cluster. The operational breakthrough lies in asymmetric memory dispatching.

The DiT model must run twenty to thirty sampling steps in rapid succession, so its weights must remain pinned inside high-speed GPU VRAM. In contrast, the Text Encoder only executes once at the start of generation (taking less than 700 milliseconds), after which it sits idle. Offloading the 9.3GB text encoder to system memory frees up massive GPU headroom with zero perceptible sampling slowdown.

# 1. Automated Setup for Linux / WSL2 (Bash)
# Clone ComfyUI, install GGUF nodes, download models, and launch
set -euo pipefail

[ ! -d "ComfyUI" ] && git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

mkdir -p custom_nodes models/diffusion_models models/text_encoders models/vae
[ ! -d "custom_nodes/ComfyUI-GGUF" ] && \
  git clone https://github.com/leejet/ComfyUI-GGUF.git custom_nodes/ComfyUI-GGUF

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt
pip install -r custom_nodes/ComfyUI-GGUF/requirements.txt

# Download model tri-pack (DiT Q4_K_M + Heretic W4A8 + VAE BF16)
curl -C - -L "https://huggingface.co/abenzerps/Qwen-Image-2.1-GGUF/resolve/main/qwen-image-2.1-Q4_K_M.gguf" \
  -o models/diffusion_models/qwen-image-2.1-Q4_K_M.gguf

curl -C - -L "https://huggingface.co/pottokao/Qwen-Image-2.1-Text-Encoder-Heretic-W4A8/resolve/main/qwen3vl_8b_w4a8_heretic.safetensors" \
  -o models/text_encoders/qwen3vl_8b_w4a8_heretic.safetensors

curl -C - -L "https://huggingface.co/abenzerps/Qwen-Image-2.1-GGUF/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors" \
  -o models/vae/qwen_image_2.1_vae_bf16.safetensors

python main.py --listen 127.0.0.1 --port 8188 --preview-method auto
# 2. Automated Setup for Windows (PowerShell)
# Run directly inside PowerShell console
$ErrorActionPreference = "Stop"

if (-not (Test-Path "ComfyUI")) {
    git clone https://github.com/comfyanonymous/ComfyUI.git
}
Set-Location "ComfyUI"

New-Item -ItemType Directory -Force -Path "custom_nodes", "models\diffusion_models", "models\text_encoders", "models\vae" | Out-Null
if (-not (Test-Path "custom_nodes\ComfyUI-GGUF")) {
    git clone https://github.com/leejet/ComfyUI-GGUF.git custom_nodes\ComfyUI-GGUF
}

python -m venv venv
.\venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt
pip install -r custom_nodes\ComfyUI-GGUF\requirements.txt

$models = @(
    @{ Url = "https://huggingface.co/abenzerps/Qwen-Image-2.1-GGUF/resolve/main/qwen-image-2.1-Q4_K_M.gguf"; Out = "models\diffusion_models\qwen-image-2.1-Q4_K_M.gguf" },
    @{ Url = "https://huggingface.co/pottokao/Qwen-Image-2.1-Text-Encoder-Heretic-W4A8/resolve/main/qwen3vl_8b_w4a8_heretic.safetensors"; Out = "models\text_encoders\qwen3vl_8b_w4a8_heretic.safetensors" },
    @{ Url = "https://huggingface.co/abenzerps/Qwen-Image-2.1-GGUF/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors"; Out = "models\vae\qwen_image_2.1_vae_bf16.safetensors" }
)

foreach ($m in $models) {
    if (-not (Test-Path $m.Out)) {
        Write-Host "Downloading $($m.Out)..." -ForegroundColor Yellow
        curl.exe -C - -L $m.Url -o $m.Out
    }
}

python main.py --listen 127.0.0.1 --port 8188 --preview-method auto

Hardware configuration matrix for local setups:

Target Hardware (GPU) Recommended DiT Model Text Encoder Quantization Active VRAM Footprint
RTX 3060 / 4060 (8GB) qwen-image-2.1-Q4_0.gguf (4.05GB) Heretic GGUF / W4A8 (System RAM) ~4.8 GB VRAM
RTX 4070 / 4070 Super (12GB) qwen-image-2.1-Q4_K_M.gguf (4.60GB) or Q5_K_M (5.22GB) Heretic W4A8 (5.88GB) ~10.5 GB - 11.2 GB VRAM (Full GPU)
RTX 4070 Ti Super / 4080 (16GB) qwen-image-2.1-Q6_K.gguf (5.88GB) or Q8_0 (7.59GB) Heretic W4A8 (5.88GB) ~12.5 GB - 14.5 GB VRAM
RTX 3090 / 4090 (24GB) qwen-image-2.1-Q8_0.gguf or vanilla BF16 Heretic BF16 (16.33GB) ~22.0 GB - 23.5 GB VRAM
RTX 5070 / 5080 (Blackwell) qwen-image-2.1-Q4_K_M.gguf Heretic NVFP4 (5.87GB) ~6.0 GB VRAM
Apple Silicon (Mac M2/M3/M4) qwen-image-2.1-Q4_K_M.gguf Heretic Q4_K_M GGUF (4.68GB) ~11 GB Unified Memory

Pro Tip for RTX 4070 (12GB VRAM): The sweet-spot combination is the Q4_K_M DiT (4.60GB) coupled with the Heretic W4A8 text encoder (5.88GB) and VAE BF16 (676MB). Total memory footprint sits at ~11.1GB, fitting squarely within the 12GB ceiling for 100% GPU acceleration with zero offloading penalties. If your system runs heavy desktop applications in parallel, launch ComfyUI with --lowvram to let the engine release the text encoder into system RAM once token conditioning finishes.

Inside ComfyUI, replace the standard UNETLoader node with Unet Loader (GGUF) and select the .gguf file. In the CLIPLoader node, pick the Heretic safetensors file and set the type selector to qwen_image.


Part 3: Diagnosis

Failing to understand the lower-level mechanics of these packages will lead to frustrating debugging loops.

The first hazard is ComfyUI version drift. Older builds like 0.34.2 have no internal registration for QwenImage21. Attempting to load workflows on outdated installations will throw missing node errors during graph deserialization:

RuntimeError: Unknown model architecture! Expected SDXL, Flux, or QwenImage21.
Missing node: TextEncodeQwenImage21 in workflow graph.

Update your ComfyUI root repository to version 0.36.0 or newer to ensure the proper custom node mappings exist.

The second trap involves Hugging Face repository selection. The root pottokao/Qwen-Image-2.1-Text-Encoder-Heretic repository contains raw sharded checkpoints intended for Python’s transformers library. These shards prepend a model.language_model. key prefix that ComfyUI’s standard loader fails to parse. ComfyUI operators must download the repacked community checkpoints (-W4A8, -NVFP4, or -GGUF) where keys are normalized.

The third constraint is legal governance. While the abliterated Heretic text encoder is licensed under Apache-2.0, the core Qwen-Image-2.1 diffusion weights remain bound by the Qwen Research License. This restricts commercial deployment without a direct commercial agreement from Alibaba.


Part 4: Resolution

Evaluate this operational decision matrix before refactoring your primary rendering pipeline:

Evaluation Metric Adopt Qwen 2.1 Uncensored If… Retain Flux.1 or SDXL If…
Content Scope You need total freedom for anatomy, surrealism, or dark themes You generate standard commercial product shots and landscapes
Prompt Complexity You write multi-clause natural language prompts with spatial logic You prefer quick comma-separated tag strings
Hardware Resources You have 16GB system RAM and an 8GB+ modern GPU You are constrained to an older 6GB graphics card or 8GB RAM
Ecosystem Maturity You are satisfied using base model capabilities out of the box Your workflow requires hundreds of specialized community LoRA styles

Final Take

The synthesis of GGUF quantization and Heretic directional ablation proves that local open-source software will always outmaneuver corporate cloud restrictions. Do not spend monthly subscription fees on locked cloud APIs when the workstation under your desk can run unrestricted inference.


Student First Assignment

  1. Download the quantized diffusion model qwen-image-2.1-Q4_K_M.gguf (4.60 GB) and the companion text encoder qwen3vl_8b_w4a8_heretic.safetensors.
  2. Construct a minimal ComfyUI workflow connecting Unet Loader (GGUF) to a CLIPLoader set to qwen_image.
  3. Test a descriptive, complex prompt containing dynamic lighting, artistic anatomy, or dramatic scenes to verify that no refusal triggers.
  4. Monitor peak VRAM utilization using nvidia-smi and compare the memory delta between full GPU loading and CPU system memory offloading.

FAQ

Why does ComfyUI fail with a missing TextEncodeQwenImage21 error?

This error indicates your ComfyUI installation is older than version 0.36.0 and does not recognize the new Qwen 2.1 model schema. Run git pull in your ComfyUI root directory to update the application core.

Can I run Qwen-Image-2.1 Uncensored on an Apple Silicon Mac?

Yes. Download the qwen-image-2.1-Q4_K_M.gguf DiT and the qwen3vl_8b_heretic-Q4_K_M.gguf text encoder. Load them via CLIPLoaderGGUF inside ComfyUI-GGUF. Macs with unified memory run this setup smoothly.

Does using the Q4_K_M quantization degrade image fidelity compared to BF16?

In empirical visual testing, the quality difference between Q4_K_M and original BF16 weights is below 1.5% in edge contrast and texture rendering, while reducing the disk footprint by over 65%.

Is the original Alibaba DiT already uncensored, and why is the text encoder the real bottleneck?

Alibaba’s native diffusion weights (DiT) never contained a hardcoded image blanker. The censorship seen in commercial cloud services stems from application safety wrappers and, primarily, the reinforcement-learning-aligned Qwen3-VL-8B-Instruct text encoder. If you pair the official unquantized DiT with the refusal-ablated Heretic text encoder, the model generates sensitive and edgy content without resistance.

Can lower-end GPUs with 4GB VRAM (like the RTX 3050 Ti) run this workflow?

It is technically possible via full CPU offload (--cpu), but practically unusable. The smallest Q4_0 quant alone requires 4.05GB of raw memory before factoring in the OS desktop or VAE decoding. Running on 4GB VRAM forces heavy system paging, stretching generation times to 15–30 minutes per frame. An 8GB VRAM card is the realistic floor for practical local generation.

Related posts