Erased, But Not Forgotten: Erased Rectified Flow Transformers Still Remain Unsafe Under Concept Attack
Official code for the CVPR 2026 findings paper. ReFlux is a attack method for light-weight fine-tuning rectified flow based T2I diffusion models with focus on content safety and robustness evaluation. The project implements LoRA-based probing on Flux, with comprehensive evaluation methodologies for assessing model behavior under adversarial conditions.
- ✅ Supports [diffusers] (You need to use my version of diffusers)
- ✅ Easy to extend and integrate
-
Install Rust (if required):
curl https://sh.rustup.rs -sSf | sh export PATH="$HOME/.cargo/bin:$PATH"
-
Install Python dependencies:
pip install transformers sentencepiece einops omegaconf pip install tokenizers==0.20.0 pip install nltk wandb openai
-
Install local packages:
cd peft pip install -e .[torch] or python setup.py install cd ../diffusers pip install -e .[torch] or python setup.py install
- Train the adversarial checkpoint (LoRA):
python train_flux_lora.py --config config/config.yaml- Run attack inference:
For quick visualization, please run attack_inference.py .
For batch experiments, please run:
from asr_evaluation import ASRCalculator
calculator = ASRCalculator(threshold=0.6)
results = calculator.calculate_batch_asr("experiments/", "baseline/")This project is inspired by and builds upon the work of Erase Anything and Erasing Concepts from Diffusion Models and other open-source projects. We thank the community for their valuable contributions.
This research tool is intended for academic and research purposes to improve the robustness and safety of AI systems. Users should ensure compliance with applicable laws and ethical guidelines when conducting research with this framework.
If you use this project in your research, please cite:
@article{jiang2025ReFlux,
title={Erased, But Not Forgotten: Erased Rectified Flow Transformers Still Remain Unsafe Under Concept Attack},
author={Nanxiang Jiang and Zhaoxin Fan and Enhan Kang and Daiheng Gao and Yun Zhou and Yanxia Chang and Zheng Zhu and Yeying Jin and Wenjun Wu},
journal={CVPR findings},
year={2026}
}For technical questions, please contact jiangnx@buaa.edu.cn.