InstructPix2Pix: Learning to Follow Image Editing Instructions

Link
Abstract

We propose a method for editing images from human instructions: given an input image and a written instruction that tells the model what to do, our model follows these instructions to edit the image. To obtain training data for this problem, we combine the knowledge of two large pretrained models -- a language model (GPT-3) and a text-to-image model (Stable Diffusion) -- to generate a large dataset of image editing examples. Our conditional diffusion model, InstructPix2Pix, is trained on our generated data, and generalizes to real images and user-written instructions at inference time. Since it performs edits in the forward pass and does not require per example fine-tuning or inversion, our model edits images quickly, in a matter of seconds. We show compelling editing results for a diverse collection of input images and written instructions.

Synth

Problem:: 단순 지시문(Instruction) 기반 이미지 편집을 위한 대규모 데이터셋이 부재함 / 기존 편집 방식들은 전체 설명, 마스크, 추가 예시 등 번거로운 입력을 요구함

Solution:: GPT-3와 Stable Diffusion을 결합하여 (이미지, 지시문, 편집된 이미지) 쌍으로 구성된 데이터셋을 자동으로 생성함 / 생성된 데이터셋으로 InstructPix2Pix라는 조건부 Diffusion 모델을 학습시킴

Novelty:: 기존의 거대 모델들을 활용해 새로운 태스크에 대한 학습 데이터셋을 생성하는 방법론 그 자체 / 단순 '설명'이 아닌 '지시문'을 따르도록 모델을 학습시킨 점 / 이미지-텍스트 두 조건에 대한 Classifier-Free Guidance Scale(sI​, sT​)을 분리하여 편집 과정을 제어한 기법

Note:: 원하는 텍스트 자체에 대한 설명문보다 변환 지시문을 생성한 접근이 신선함 / 논문에 텍스트가 이렇게 없다니..

Summary

Motivation

Method

file-20250702013803028.png

방법론은 크게 두 단계임: (1) 데이터셋 생성, (2) 생성된 데이터셋으로 조건부 Diffusion 모델 학습.

Training Data Generation

Instruction-following Diffusion Model

eθ~(zt,cI,cT)=eθ(zt,,)+sI(eθ(zt,cI,)eθ(zt,,))+sT(eθ(zt,cI,cT)eθ(zt,cI,))

Method 검증