1 Guangdong University of Technology, 2 Huizhou University
† Corresponding author
This repository provides the standalone public release of Navi-FlowAlign, the FlowAlign-based instantiation of NaviEdit for real-image editing.
NaviEdit is a training-free controller that decouples edit progress from model scale traversal. This release keeps only the method-specific code needed for:
- the standalone Navi-FlowAlign editing pipeline
- a lightweight Gradio demo
- PIE-Bench export in the layout expected by the official PnP evaluation code
- Stable Diffusion 3 Medium (diffusers): stabilityai/stable-diffusion-3-medium-diffusers
- PIE-Bench / PnP evaluation code: cure-lab/PnPInversion
Please make sure you have accepted the Stability AI model license on Hugging Face before downloading the SD3 weights.
- Python 3.12 or newer
- PyTorch with CUDA support
- Stable Diffusion 3 Medium in diffusers format
--model-root can be either:
- a local checkpoint directory such as
/path/to/stable-diffusion-3-medium-diffusers - a Hugging Face model id such as
stabilityai/stable-diffusion-3-medium-diffusers
pip install -r requirement.txtLaunch the interactive demo:
python app.py \
--model-root /path/to/stable-diffusion-3-medium-diffusers \
--server-port 7860If you want to reuse defaults from an existing editor config, you can point --config at a YAML file containing method_config::
python app.py \
--config /path/to/piebench_full.yaml \
--model-root /path/to/stable-diffusion-3-medium-diffusers \
--server-port 7860Running python app.py launches a local Gradio app for Navi-FlowAlign.
- Left panel: upload the source image and provide source / target prompts
- Right panel: view the edited output image
- Bottom section: click built-in examples to auto-fill the inputs
Optional examples can be placed under images/ using the same lightweight demo layout:
images/
001/
i.jpg
meta.jsonl
Each line in meta.jsonl should contain at least:
{"original_prompt": "...", "edited_prompt": "..."}Export predictions in PIE-Bench format with:
python run_pie_bench.py \
--model-root /path/to/stable-diffusion-3-medium-diffusers \
--pie-root /path/to/pie_benchYou can also reuse an existing config:
python run_pie_bench.py \
--config /path/to/piebench_full.yaml \
--model-root /path/to/stable-diffusion-3-medium-diffusers \
--pie-root /path/to/pie_bench--pie-root should point to a PIE-Bench folder containing at least:
annotation_images/— the original PIE-Bench imagesmapping_file.json— prompt and metadata annotations
Example layout:
pie_bench/
annotation_images/
mapping_file.json
The script writes predictions to:
<pie-root>/output/NaviEdit/annotation_images/...
and can optionally synchronize:
<pie-root>/data/mapping_file.json
<pie-root>/data/annotation_images/...
This matches the export pattern expected by the official PIE-Bench / PnP evaluation code.
For PIE-Bench data preparation and evaluation protocol details, please refer to: https://github.com/cure-lab/PnPInversion
naviedit/
app.py # Gradio demo entrypoint
run_pie_bench.py # PIE-Bench export entrypoint
pipeline_factory.py # Pipeline construction and runtime defaults
pipeline_naviedit.py # Standalone Navi-FlowAlign pipeline wrapper
model.py # Navi-FlowAlign controller core
sd3_bundle.py # SD3 loading, text encoding, VAE adapter
utils.py # Config loading and example discovery
images/ # Optional local demo examples
If you find our work helpful, please consider starring this repository and citing:
@article{lu2026naviedit,
title={Semantic granularity navigation in image editing},
author={Lu, Liangsi and Guo, Minzhe and Chen, Xuhang and Shi, Yang},
journal={arXiv preprint arXiv:2605.21190},
year={2026}
}