Coder Social home page Coder Social logo

differential-diffusion's Introduction

Differential Diffusion: Giving Each Pixel its strength

Eran Levin, Ohad Fried
Tel Aviv University, Reichman University
Diffusion models have revolutionized image generation and editing, producing state-of-the-art results in conditioned and unconditioned image synthesis. While current techniques enable user control over the degree of change in an image edit, the controllability is limited to global changes over an entire edited region. This paper introduces a novel framework that enables customization of the amount of change per pixel or per image region. Our framework can be integrated into any existing diffusion model, enhancing it with this capability. Such granular control on the quantity of change opens up a diverse array of new editing capabilities, such as control of the extent to which individual objects are modified, or the ability to introduce gradual spatial changes. Furthermore, we showcase the framework's effectiveness in soft-inpainting---the completion of portions of an image while subtly adjusting the surrounding areas to ensure seamless integration. Additionally, we introduce a new tool for exploring the effects of different change quantities. Our framework operates solely during inference, requiring no model training or fine-tuning. We demonstrate our method with the current open state-of-the-art models, and validate it via both quantitative and qualitative comparisons, and a user study.


Table of Contents

Requirements

  • Python (version 3.9)
  • GPU (NVIDIA CUDA compatible)
  • Virtualenv (optional but recommended)

Installation

  • Create a virtual environment (optional but recommended):

    python -m venv venv

    Activate the virtual environment:

    On Windows:

    venv\Scripts\activate

    On Unix or MacOS:

    source venv/bin/activate
  • Install the required dependencies:

    pip install -r requirements.txt

Usage

  • Ensure that your virtual environment is activated.

  • Make sure that your GPU is properly set up and accessible.

  • For Stable Diffusion 2.1:

    • Run the script:

      python SD2/run.py
  • For Stable Diffusion XL:

    • Run the script:

      python SDXL/run.py
  • For Kandinsky 2.2:

    • Run the script:

      python Kandinsky/run.py
  • For DeepFloyd IF:

    • Run the script:

      python IF/run.py

Citation

@misc{levin2023differential,
      title={Differential Diffusion: Giving Each Pixel Its Strength}, 
      author={Eran Levin and Ohad Fried},
      year={2023},
      eprint={2306.00950},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

differential-diffusion's People

Contributors

exx8 avatar

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.