/InstDiffEdit

The code of Towards Efficient Diffusion-Based Image Editing with Instant Attention Masks

Primary LanguagePython

InstDiffEdit

This repository contains the implementation of the AAAI 2024 paper:

Towards Efficient Diffusion-Based Image Editing with Instant Attention Masks [Paper] [AAAI]
Siyu Zou1, Jiji Tang2, Yiyi Zhou1, Jing He1, Chaoyi Zhao2, Rongsheng Zhang2, Zhipeng Hu2, Xiaoshuai Sun1
1Key Laboratory of Multimedia Trusted Perception and Efficient Computing, Ministry of Education of China, Xiamen University
2Fuxi AI Lab, NetEase Inc., Hangzhou

Model Architecture

Model_architecture

Code Path

Code Structures

There are four parts in the code.

  • model: It contains the implement files for InstDiffEdit, DiffEdit and SDEdit.
  • dataset_txt: It contains the data splits of Imagen, ImageNet and Editing-Mask dataset.
  • dataset: It contains the image and mask of Editing-Mask dataset.
  • .sh: The inference scripts for InstDiffEdit.

Dependencies

  • Python 3.8
  • PyTorch == 1.13.1
  • Transformers == 4.25.1
  • diffusers == 0.8.0
  • NumPy
  • All experiments are performed with one A30 GPU.

Datasets

There are two pdataset we used.

Eval & Sample

Sample begin:

bash sample_begin.sh

Run in the Imagen or ImageNet or Editing-Mask:

bash run.sh

Note:

  • Diffedit and SDEdit can be used by the .sh file with some parameter changes.
  • you can open the .sh file for parameter modification.