Official Implementation of [Addressing Text Embedding Leakage in Diffusion-based Image Editing (ICCV 2025)]
ALE is a training-free image editing framework that prevents attribute leakage in text-guided diffusion-based editing.
It is accompanied by ALE-Bench, a benchmark for evaluating attribute leakage in multi-object text-based image editing.
ALE performs lakage-free edits guided by text prompts, while prior methods show attribute leakages.
ale/ # Core implementation of ALE
│
├── edit.py # Main editing pipeline
├── pipeline_ead.py # Diffusion pipeline for editing
├── ore.py # Object-Restricted Embedding (ORE)
├── rgb_cam.py # Region-Guided Blending for Cross-Attention Masking (RGB-CAM)
├── attention_control.py # Background Blending (BB) and self-attention injection
├── sam_utils.py # SAM-based segmentation utilities
├── config.py # Configuration utilities
│
ale_bench/ # ALE-Bench benchmark dataset
│ ├── images/ # Source images
│ ├── masks/ # Object masks (for evaluation)
│ └── prompts/ # Source–target prompt pairs
│
evaluate/ # Evaluation scripts
│ ├── evaluate_ale.py # Metric computation & statistics generation
│ └── metrics_calculator.py # Metric definitions (CLIP, PSNR, SSIM, LPIPS, etc.)
│
outputs/ # SAM outputs
results/ # Edited outputs generated by ALE
stats/ # Evaluation results (CSV + XLSX)
│
ale_gradio.py # Gradio demo interface
run_ale_bench.py # Run ALE on ALE-Bench
README.md
.gitignore
1️⃣ Create the Conda environment
conda env create -f environment.yaml2️⃣ Install SAM2
Follow the official installation instructions.
3️⃣ Activate the environment
conda activate aleLaunch the interactive editing interface:
python ./ale_gradio.pyThis opens a Gradio app where you can:
- Load source images and masks
- Enter source and target prompts
- Perform localized, leakage-free text-guided editing
Automatically perform batch editing on the benchmark dataset:
python ./run_ale_bench.pyThis script:
- Loads images, prompts, and masks from
ale_bench/ - Runs the ALE pipeline
- Saves generated results under
./results/
Compute quantitative metrics and aggregate statistics:
python ./evaluate/evaluate_ale.pyThis script:
-
Loads edited results from
./results/ -
Computes metrics (TELS, TILS, Editing Performance, PSNR, SSIM, LPIPS, etc.)
-
Saves:
evaluation_results.csv- Aggregated Excel summaries (
ale_mean_*.xlsx)
All saved under the ./stats/ directory.
Example output:
stats/
├── evaluation_results.csv
├── ale_mean_per_target_count.xlsx
├── ale_mean_per_edit_type.xlsx
├── ale_mean_per_target_count_edit_type.xlsx
└── ale_mean_all.xlsx
| Metric | Description | Direction |
|---|---|---|
| TELS | Target-External Leakage Score — leakage into background/unrelated regions | Lower is better |
| TILS | Target-Internal Leakage Score — leakage between different edited objects | Lower is better |
| Editing Performance | CLIP-based alignment between target prompts and edited regions | Higher is better |
| PSNR / SSIM / LPIPS / Structure Distance | Standard image similarity metrics | Higher / Lower accordingly |
ALE achieves faithful, localized, and leakage-free edits guided by text prompts.
Qualitative comparison with existing editing methods.
If you use ALE or ALE-Bench, please cite:
@InProceedings{mun2025ale,
author = {Mun, Sunung and Nam, Jinhwan and Cho, Sunghyun and Ok, Jungseul},
title = {Addressing Text Embedding Leakage in Diffusion-based Image Editing},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
year = {2025},
url = {https://arxiv.org/abs/2412.04715},
}Sunung Mun POSTECH AI Graduate School 📧 [email protected]
Jinhwan Nam POSTECH AI Graduate School 📧 [email protected]
This repository builds upon the open-source implementations of InfEdit and Prompt-to-Prompt.


