Gemma 4 E2B Uncensored Image Caption Adapter
A multimodal LoRA adapter fine-tuned for image understanding and image caption generation.
A sankaku browser for inference testing is provided in repo at https://huggingface.co/codeShare/gemma-4-E2B-it-heretic-image-caption-adapter/blob/main/sankaku_database_browse_and_caption.ipynb
Description
This is an early version trained on approximately 3,000 AI-generated images and prompts for models such as Chroma, Krea 2 and Moss Image.
The adapter is designed to improve the image captioning capabilities of an abliterated Gemma 4 E2B model, particularly for generating prompts for creating AI-generated imagery.
The underlying model has had its refusal behavior modified through abliteration. This adapter aims to improve its image-description capabilities.
Model information
| Property | Value |
|---|---|
| Base model | coder3101/gemma-4-E2B-it-heretic |
| Architecture | PEFT LoRA |
| Format | Safetensors |
| Task | Image captioning |
| Processor | Included |
Installation
pip install torch transformers peft accelerate safetensors pillow
Loading the adapter
import torch
from transformers import AutoProcessor, AutoModelForMultimodalLM
from peft import PeftModel
BASE_MODEL = "coder3101/gemma-4-E2B-it-heretic"
ADAPTER = "codeShare/gemma-4-E2B-it-heretic-image-caption-adapter"
processor = AutoProcessor.from_pretrained(ADAPTER)
base_model = AutoModelForMultimodalLM.from_pretrained(
BASE_MODEL,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER,
)
model.eval()
Usage
Use the included processor and the conversation format supported by the base model.
This repository contains a standard PEFT LoRA adapter, not a merged standalone model.
Training
Multimodal QLoRA fine-tuning.
The original training dataset and private training artifacts are not included.
License
Please refer to the base model's license and usage restrictions.