Practical overview
When it fits
Use it when conducting research on diffusion-based adversarial image attacks and you can provide the documented GPU, software, model, and dataset prerequisites.
Who it is for
- Researchers studying adversarial machine learning and diffusion models.
- Practitioners evaluating adversarial image attacks across model architectures or defenses.
Documented uses
- Explore adversarial perturbation generation in a diffusion model's latent space.
- Investigate whether crafted examples transfer to other models, including black-box targets.
- Compare attack behavior across documented datasets, model structures, and defenses.
Requirements & limits
The repository is public and lists an Apache-2.0 license.
- The documented baseline requires a high-end NVIDIA GPU with at least 16 GB of memory, Python 3.8, CUDA 11.3, and cuDNN 8.4.1.
- The implementation uses Stable Diffusion 2.0, and the README describes a backed-up model path because the original repository may be unavailable.
- The README reports support for diffusers 0.30.3, while recommending diffusers 0.9.0 and a backed-up script for reproducing paper results; dependency versions can affect results.
- Additional pretrained adversarially trained models are described for experiments involving particular defenses.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare a dataset configuration for DiffAttack
Set up image and label paths for one of the documented datasets before using the repository's attack code.
Before you start
- Python 3.8, CUDA 11.3, cuDNN 8.4.1, and a high-end NVIDIA GPU with at least 16 GB memory.
- Repository requirements installed with pip install -r requirements.txt.
- A demo dataset, ImageNet-Compatible data, or the documented CUB_200_2011 or Stanford Cars data.
- Stable Diffusion 2.0 weights, using the README's backed-up model path if the original path is unavailable.
Steps
Install the repository's requirements using pip install -r requirements.txt.
For ImageNet-Compatible or either supplementary dataset, obtain the relevant data and configure --images_root and --label_path in main.py.
For CUB_200_2011 or Stanford Cars, also set --dataset_name to cub_200_2011 or standford_car, respectively.
Set --pretrained_diffusion_path in main.py to the documented backed-up Stable Diffusion 2.0 model path if needed.
Expected outcome
The documented dataset and diffusion-model paths are configured for the repository's attack workflow.
Guide limitations
- The README's requirements and setup instructions do not by themselves establish that an attack run will succeed on a particular machine.
- Paper-result reproduction is version-sensitive; the README recommends diffusers==0.9.0 and diff_latent_attack-0.9.0.py for reproducing its reported results.
- The README notes that the original Stable Diffusion 2 base repository may be unavailable.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 27 November 2026
- Original website title
- WindVChen/DiffAttack · Official homepage title · retained in its source language

