syunar / MirrorDiffusion

zero-shot image-to-image translation, diffusion model, prompt, image-to-image translation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MirrorDiffusion

[Project Homepage] [paper]

comparison

Method

method

Getting Started

Environment Setup

  • We provide a conda env file that contains all the required dependencies
    conda env create -f environment.yml
    
  • Following this, you can activate the conda environment with the command below.
    conda activate mirrordiffusion
    

Download Dataset

Real Image Translation

  • First, run the inversion command below to obtain the input noise that reconstructs the image.
    python src/null_inversion.py   --input_image ./assets/test_images/cat/  --results_folder ./exp_output/stable_cat/ --num_ddim_steps 60
  • Next, we can perform image editing with the editing direction as shown below.
    python src/null_edit.py     --inversion "test/stable_cat/null_inversion/"     --prompt "test/stable_cat/prompt/"     --task_name "cat2dog" --results_folder ./exp_output/sketch_cat/  --num_ddim_steps 60

Finding Custom Edit Directions

   python generate_direction.py

Comparison

simple_comparison

Acknowledgement

This project is build based on Pix2Pix-Zero and Null-Text Inversion. We thank the authors for sharing their code.

About

zero-shot image-to-image translation, diffusion model, prompt, image-to-image translation

License:MIT License


Languages

Language:Python 100.0%