Instructions to use DreamFast/gemma-3-12b-it-heretic-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DreamFast/gemma-3-12b-it-heretic-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DreamFast/gemma-3-12b-it-heretic-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("DreamFast/gemma-3-12b-it-heretic-v2") model = AutoModelForMultimodalLM.from_pretrained("DreamFast/gemma-3-12b-it-heretic-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use DreamFast/gemma-3-12b-it-heretic-v2 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="DreamFast/gemma-3-12b-it-heretic-v2", filename="gguf/gemma-3-12b-it-heretic-v2-Q3_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use DreamFast/gemma-3-12b-it-heretic-v2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M # Run inference directly in the terminal: llama cli -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M # Run inference directly in the terminal: llama cli -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
Use Docker
docker model run hf.co/DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use DreamFast/gemma-3-12b-it-heretic-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DreamFast/gemma-3-12b-it-heretic-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DreamFast/gemma-3-12b-it-heretic-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
- SGLang
How to use DreamFast/gemma-3-12b-it-heretic-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DreamFast/gemma-3-12b-it-heretic-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DreamFast/gemma-3-12b-it-heretic-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "DreamFast/gemma-3-12b-it-heretic-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DreamFast/gemma-3-12b-it-heretic-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use DreamFast/gemma-3-12b-it-heretic-v2 with Ollama:
ollama run hf.co/DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
- Unsloth Studio
How to use DreamFast/gemma-3-12b-it-heretic-v2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DreamFast/gemma-3-12b-it-heretic-v2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DreamFast/gemma-3-12b-it-heretic-v2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for DreamFast/gemma-3-12b-it-heretic-v2 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use DreamFast/gemma-3-12b-it-heretic-v2 with Docker Model Runner:
docker model run hf.co/DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
- Lemonade
How to use DreamFast/gemma-3-12b-it-heretic-v2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull DreamFast/gemma-3-12b-it-heretic-v2:Q4_K_M
Run and chat with the model
lemonade run user.gemma-3-12b-it-heretic-v2-Q4_K_M
List all available models
lemonade list
Gemma 3 12B IT - Heretic v2 (Abliterated)
An abliterated version of Google's Gemma 3 12B IT created using Heretic v1.3.0. This model has reduced refusals while maintaining model quality, making it suitable as an uncensored text encoder for video generation models like LTX-2.
Available in five quantization formats for ComfyUI — FP8, INT8 (ConvRot), NVFP4, and MXFP8 — covering everything from Ada GPUs to Blackwell.
You can see the docker, scripts and configurations used to make these files on Heretic Docker Github.
Update — July 11, 2026
Added INT8 (ConvRot) and MXFP8 quantization formats via convert-to-quant by silveroxides:
- INT8 ConvRot: Near-lossless INT8 via SVD-guided learned rounding (Prodigy optimizer), tensor-wise scaling. Works on any GPU (Ampere+), natively supported in ComfyUI v0.27.0+. 13 GB.
- MXFP8: Microscaling FP8 (OCP MX standard) with E8M0 per-block power-of-2 scales. Blackwell only. 13 GB.
- FP8 upgraded: Now uses per-tensor scaling via convert-to-quant (previously naive unscaled cast).
- Pipeline now uses convert-to-quant for FP8, INT8, and MXFP8 quantization with ComfyUI-compatible
comfy_quantmetadata output.
What's new in v2
- Heretic v1.3.0 with 200 trials (v1 used v1.1.0 with 100 trials)
- Better trial selection: Trial 174 — 8/100 refusals at KL 0.0801 (v1: Trial 99, 7/100 refusals at KL 0.0826)
- Vision preserved: All ComfyUI variants keep
vision_modelandmulti_modal_projectorkeys for I2V prompt enhancement - Five quantization formats: FP8, INT8 (ConvRot), NVFP4, MXFP8, plus GGUF — for every GPU tier
- INT8 ConvRot: Near-lossless INT8 via learned rounding optimization, works on any GPU (Ampere+), natively supported in ComfyUI v0.27.0+
- MXFP8: Microscaling FP8 (OCP MX standard) with E8M0 block scales for Blackwell
- Updated GGUF support: ComfyUI-GGUF now has merged Gemma 3 support (PR #402)
Model Details
- Base Model: google/gemma-3-12b-it
- Abliteration Method: Heretic v1.3.0
- Trials: 200
- Trial Selected: Trial 174
- Refusals: 8/100 (vs 100/100 original)
- KL Divergence: 0.0801 (minimal model damage)
Files
HuggingFace Format (for transformers, llama.cpp conversion)
model-00001-of-00005.safetensors
model-00002-of-00005.safetensors
model-00003-of-00005.safetensors
model-00004-of-00005.safetensors
model-00005-of-00005.safetensors
config.json
tokenizer.model
tokenizer.json
tokenizer_config.json
ComfyUI Format (with vision, for LTX-2 T2V and I2V)
| File | Format | Size | HW | Description |
|---|---|---|---|---|
gemma-3-12b-it-heretic-v2.safetensors |
bf16 | 23 GB | Any | Full precision |
gemma-3-12b-it-heretic-v2_fp8_e4m3fn.safetensors |
FP8 E4M3 | 12 GB | Ada+ | Per-tensor scaled |
gemma-3-12b-it-heretic-v2_int8.safetensors |
INT8 | 13 GB | Any | ConvRot learned rounding, tensor-wise |
gemma-3-12b-it-heretic-v2_nvfp4.safetensors |
NVFP4 E2M1 | 7.8 GB | Blackwell | 4-bit float, double quantization |
gemma-3-12b-it-heretic-v2_mxfp8.safetensors |
MXFP8 | 13 GB | Blackwell | Microscaling FP8, E8M0 block scales |
All ComfyUI variants include vision (vision_model and multi_modal_projector weights). The vision weights are unused during T2V (text-to-video) and add minimal overhead (~1 GB). For I2V (image-to-video) workflows using TextGenerateLTX2Prompt with an image input, the vision weights are required.
Quantization Format Details
FP8 (E4M3) — Per-tensor scaled quantization via convert-to-quant. Works on Ada (RTX 4090) and newer. Good balance of size and quality.
INT8 (ConvRot) — Tensor-wise symmetric INT8 with ConvRot learned rounding optimization via convert-to-quant. For each weight tensor, an SVD-guided gradient descent loop (Prodigy optimizer) learns the optimal rounding direction to minimize output error, producing near-lossless INT8 quality. Works on any modern GPU (Ampere+), no Blackwell required. Natively supported in ComfyUI v0.27.0+.
NVFP4 (E2M1) — 4-bit floating point with double quantization (per-tensor f32 scale + per-block FP8 scale, block size 16). ~3x smaller than bf16, loads natively in ComfyUI without any plugins. Blackwell GPUs (RTX 5090/5080, SM100+) use native FP4 tensor cores for best performance. Software dequantization works on older GPUs (tested on RTX 4090).
MXFP8 — Microscaling FP8 (OCP MX standard). FP8 E4M3 data with E8M0 (power-of-2) per-block scales using 32-element blocks. Better dynamic range handling than per-tensor FP8. Requires SM100+ (Blackwell). Quantized via convert-to-quant.
GGUF Format (for llama.cpp and ComfyUI-GGUF)
| Quant | Size | Notes |
|---|---|---|
| F16 | 22GB | Lossless reference |
| Q8_0 | 12GB | Excellent quality |
| Q6_K | 9.0GB | Very good quality |
| Q5_K_M | 7.9GB | Good quality |
| Q5_K_S | 7.7GB | Slightly smaller Q5 |
| Q4_K_M | 6.8GB | Recommended balance |
| Q4_K_S | 6.5GB | Smaller Q4 variant |
| Q3_K_M | 5.6GB | For low VRAM only |
GGUF files are text-only (no vision). They work with llama.cpp directly and with ComfyUI via ComfyUI-GGUF.
Do abliterated models make a difference for LTX-2?
I had a deep dive into this topic and found that the impact is nuanced. Abliteration does alter the embeddings Gemma produces, which slightly changes the generated video. However, there are fundamental limitations:
- Gemma doesn't know what it wasn't trained on. The base model was never trained on more taboo content. Abliteration removes refusals, but the model simply doesn't have knowledge of things it was never exposed to. Even chatting with the heretic model in llama.cpp, it doesn't refuse — it just doesn't know.
- LTX-2 was trained on original Gemma embeddings. The DiT expects the embedding distribution from the unmodified text encoder. Fine-tuning the text encoder itself would break the DiT, as it wouldn't know what to do with the new embedding distribution and would produce strange results.
- Most abliteration happens on layer 48 (the final decision-making layer), but LTX-2 averages across all layers, which may wash out the difference.
A potential approach would be combining a fine-tuned abliterated text encoder with a LoRA trained to understand the new embeddings. LoRAs for LTX exist, but no fine-tuned text encoders have been released yet as far as I know.
That said, abliteration still removes the soft censorship in the embeddings, which can result in more faithful prompt encoding for creative content.
Usage
With Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"DreamFast/gemma-3-12b-it-heretic-v2",
device_map="auto",
torch_dtype=torch.bfloat16
)
tokenizer = AutoTokenizer.from_pretrained("DreamFast/gemma-3-12b-it-heretic-v2")
prompt = "Write a story about a bank heist"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
With ComfyUI (LTX-2)
Download a ComfyUI format file from the
comfyui/folder:- INT8 (recommended, any GPU):
gemma-3-12b-it-heretic-v2_int8.safetensors(13 GB) - FP8 (fast, Ada+):
gemma-3-12b-it-heretic-v2_fp8_e4m3fn.safetensors(12 GB) - NVFP4 (smallest, Blackwell):
gemma-3-12b-it-heretic-v2_nvfp4.safetensors(7.8 GB) - MXFP8 (Blackwell):
gemma-3-12b-it-heretic-v2_mxfp8.safetensors(13 GB) - bf16 (full precision):
gemma-3-12b-it-heretic-v2.safetensors(23 GB)
- INT8 (recommended, any GPU):
Place in
ComfyUI/models/text_encoders/In your LTX-2 workflow, use the
LTXAVTextEncoderLoadernode and select the heretic file
Note: INT8 requires ComfyUI v0.27.0+ (native int8_tensorwise support). For best inference speed, launch ComfyUI with --enable-triton-backend.
Tip: For multi-GPU setups or CPU offloading, check out ComfyUI-LTX2-MultiGPU for optimized LTX-2 workflows.
With ComfyUI-GGUF
GGUF support for Gemma 3 text encoders is now merged in ComfyUI-GGUF (PR #402).
- Download a GGUF file (Q4_K_M recommended for most setups)
- Place in
ComfyUI/models/text_encoders/ - Use the
DualCLIPLoader (GGUF)node:- CLIP 1: the Gemma 3 GGUF file
- CLIP 2: embedding connectors from Kijai/LTXV2_comfy (use the dev connectors, not distilled)
Note: GGUF text encoders are text-only (no vision). For I2V prompt enhancement with image input, use the safetensors variants.
With llama.cpp
# Using llama-server
llama-server -m gemma-3-12b-it-heretic-v2-Q4_K_M.gguf
# Or with llama-cli
llama-cli -m gemma-3-12b-it-heretic-v2-Q4_K_M.gguf -p "Write a story about a bank heist"
Why Abliterate?
Even when Gemma doesn't outright refuse a prompt, it may "sanitize" or weaken certain concepts in the embeddings. For video generation with LTX-2, this can result in:
- Weaker adherence to creative prompts
- Softened or altered visual outputs
- Less faithful representation of requested content
Abliteration removes this soft censorship, resulting in more faithful prompt encoding.
Abliteration Process
Created using Heretic v1.3.0 with 200 optimization trials:
? Which trial do you want to use?
[Trial 80] Refusals: 0/100, KL divergence: 0.6098
[Trial 66] Refusals: 2/100, KL divergence: 0.2087
[Trial 75] Refusals: 3/100, KL divergence: 0.1378
[Trial 67] Refusals: 6/100, KL divergence: 0.1108
[Trial 180] Refusals: 7/100, KL divergence: 0.0996
> [Trial 174] Refusals: 8/100, KL divergence: 0.0801 <-- selected
[Trial 178] Refusals: 10/100, KL divergence: 0.0801
[Trial 172] Refusals: 11/100, KL divergence: 0.0708
...
Trial 174 was selected for its low KL divergence (0.0801), indicating minimal model damage, while achieving 8/100 refusals (92% of previously-refused prompts now work).
Limitations
- This model inherits all limitations of the base Gemma 3 12B model
- Abliteration reduces but does not completely eliminate refusals
- NVFP4 and MXFP8 quantization work best on Blackwell GPUs (RTX 5090/5080) with native tensor cores; NVFP4 also works on older GPUs via software dequantization
- INT8 requires ComfyUI v0.27.0+ for native int8_tensorwise support
License
This model is subject to the Gemma license.
Acknowledgments
- Google for the Gemma 3 12B model
- Heretic by p-e-w for the abliteration tool
- convert-to-quant by silveroxides for INT8 ConvRot, FP8 scaling, and MXFP8 quantization
- comfy_kitchen by Comfy-Org for NVFP4/MXFP8 CUDA kernels
- Lightricks for LTX-2
- llama.cpp for GGUF conversion
- ComfyUI-GGUF for Gemma 3 GGUF support
- Downloads last month
- 7,995