How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("JovanHengGhimHong/unsafe2safe_checkpoint", dtype=torch.bfloat16, device_map="cuda")

prompt = "Turn this cat into a dog"
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")

image = pipe(image=input_image, prompt=prompt).images[0]

Unsafe2Safe Checkpoint - Unofficial Reproduction

This repository contains an unofficial Safe Attention based UNet checkpoint trained by following the methodology described in the Unsafe2Safe paper.

This is an independent reproduction and is not affiliated with or endorsed by the original paper authors. Implementation details and model behavior may differ from the authors' unreleased implementation and weights.

Unofficial implementation: https://github.com/JovanHengGhimHong/Unsafe2Safe_Unofficial_Reproduction

Original Paper

Unsafe2Safe: Controllable Image Anonymization for Downstream Utility

Mih Dinh, SouYoung Jin

Paper: https://arxiv.org/abs/2603.28605

Please cite the original paper when using this checkpoint or implementation.

Citations

@article{dinh2026unsafe2safe,
  title = {Unsafe2Safe: Controllable Image Anonymization for Downstream Utility},
  author = {Dinh, Mih and Jin, SouYoung},
  journal = {CVPR 2026},
  year = {2026}
}

@inproceedings{zhang2023magicbrush,
  title = {MagicBrush: A Manually Annotated Dataset for Instruction-Guided Image Editing},
  author = {Zhang, Kai and Mo, Lingbo and Chen, Wenhu and Sun, Huan and Su, Yu},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023}
}

@inproceedings{brooks2023instructpix2pix,
  title = {InstructPix2Pix: Learning to Follow Image Editing Instructions},
  author = {Brooks, Tim and Holynski, Aleksander and Efros, Alexei A.},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023}
}

Disclaimer

This model does not guarantee complete or irreversible anonymization. Privacy-sensitive information may remain visible or inferable from image content, text, background context, metadata, or model-generated artifacts. Outputs should be independently evaluated before use in privacy-critical applications.

Downloads last month
11
Safetensors
Model size
0.9B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for JovanHengGhimHong/unsafe2safe_checkpoint