Instructions to use nexh98/clamp-checkpoints with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nexh98/clamp-checkpoints with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nexh98/clamp-checkpoints", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
CLAMP checkpoints
Checkpoints from "Trapping harmful finetuning" (CLAMP), CVPR 2026.
Classification
last.ckptโ image classification (ResNet18/ImageNet, Cars as harmful, Country211 as benign) immunization checkpoint. Produces the paper's Cars-rowTab. classificationnumbers.
Diffusion
diffusion/clamp_ESD/pytorch_lora_weights.safetensorsโ Stable Diffusion V1-4 LoRA immunization checkpoint (rank 8, alpha 16, 50 epochs, lr=2e-4). Produces the paper'sTab. diffusionCLAMP row.diffusion/base_model/โ the ESD-erased Stable Diffusion V1-4 base pipeline the LoRA was trained on top of (sub-concepts erased via ESD, per the paper's methodology). Required to reproduce the paper's numbers; applying the LoRA to vanilla SD v1.4 instead will run but won't match the paper.diffusion/inference.pyโ a minimal, verified-working example that downloads both of the above and runs generation.
Usage
pip install diffusers transformers torch accelerate safetensors huggingface_hub
python diffusion/inference.py
Note: pipe.load_lora_weights() and unet.load_lora_adapter() (the current recommended
diffusers APIs) do not work with this checkpoint โ they silently attach zero LoRA
parameters because the file was saved in the older UNet-level save_attn_procs format, whose
key prefixes don't match what those newer methods expect. Use unet.load_attn_procs(...)
instead (deprecated but functional), exactly as diffusion/inference.py does. This was
confirmed by checking unet.named_parameters() for attached LoRA params after each loading
method โ the pipeline-level methods report success without actually loading anything.
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support