GithubHelp home page GithubHelp logo

tchuanm / iterinv Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 176 KB

The official implement of "IterInv: Iterative Inversion for Pixel-Level T2I Models".

Jupyter Notebook 2.11% Python 97.84% Shell 0.06%

iterinv's Introduction

(NeurIPS 2023 Workshop on Diffusion Models) & ICME 2024

Environment Setting

  1. Our code is based on diffusers-0.19.0
  2. Download the dataset from GoogleDrive.
  3. create environment.
conda create --name floyd --file environment.yml
conda activate floyd
  1. If you want to get a prompt of our own images, you can use BLIP_2.ipynb to get the text prompt.

Reconstruction Image

  1. Reconstruct a image based on IterInv.
python end2end_inv.py \
    --input_image 'images/pix2pix-zero/cat/cat_7.png'  \
    --results_folder  'output/all_imgs_inversion_in_prompt_file'  \
    --prompt_str 'a cat' 
    --enable_1 \
    --enable_3for2 \
    --enable_3 \
# or
bash bashes/bash_inv_1img.sh                 
  1. Reconstruct multiple images based on IterInv.
python bashes/ours_inv_multi_prompt.py
  1. Reconstruct based on DDIM Inversion. Choose stage 1/2/3 to groups what you want.
python bashes/ddim_inv_multi_prompts.py 
# including ddim_stage23_inv.py ddim_failure_stage_3.py  end2end_ddim_inv.py to chooose.
  1. Reconstruct based on SDXL.
python SDXL.py
# or in SDXL.ipynb to run it one-by-one step for better development. 

Editing images

  1. editing with IterInv + DiffEdit.
python end2end_diffedit.py \ 
    --enable_1  --enable_3for2 --enable_3     \
    --inpaint_strength 0.4 

Quantitative comparison of inversion results.

python evaluation_scores.py  
# or single-step debug in evaluation_scores.ipynb

Change the folder to choose what you want to evaluate.

Acknowledgement

Thanks for the diffusers and DeepFloyd-IF, which helps us to quickly implement our ideas.
Note: this is our draft code release for paper. The cleaned version will be released later.

Citation

If our work is useful for your research, you can consider citing:

@article{tang2023iterinv,
  title={IterInv: Iterative Inversion for Pixel-Level T2I Models},
  author={Tang, Chuanming and Wang, Kai and van de Weijer, Joost},
  journal={arXiv preprint arXiv:2310.19540},
  year={2023}
}

iterinv's People

Contributors

tchuanm avatar

Stargazers

 avatar  avatar  avatar Lu Ming avatar kai wang avatar

Watchers

kai wang avatar  avatar

Forkers

wangkai930418

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.