Skip to main content
QUICK REVIEW

[论文解读] IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models

Ye Hu, Jun Zhang|arXiv (Cornell University)|Aug 13, 2023
Generative Adversarial Networks and Image Synthesis被引用 109
一句话总结

IP-Adapter 引入了一种轻量、解耦的跨注意力图像-提示适配器,用于预训练的文本到图像扩散模型,在大约 22M 参数下实现图像提示能力,并具备强大的泛化能力。

ABSTRACT

Recent years have witnessed the strong power of large text-to-image diffusion models for the impressive generative capability to create high-fidelity images. However, it is very tricky to generate desired images using only text prompt as it often involves complex prompt engineering. An alternative to text prompt is image prompt, as the saying goes: "an image is worth a thousand words". Although existing methods of direct fine-tuning from pretrained models are effective, they require large computing resources and are not compatible with other base models, text prompt, and structural controls. In this paper, we present IP-Adapter, an effective and lightweight adapter to achieve image prompt capability for the pretrained text-to-image diffusion models. The key design of our IP-Adapter is decoupled cross-attention mechanism that separates cross-attention layers for text features and image features. Despite the simplicity of our method, an IP-Adapter with only 22M parameters can achieve comparable or even better performance to a fully fine-tuned image prompt model. As we freeze the pretrained diffusion model, the proposed IP-Adapter can be generalized not only to other custom models fine-tuned from the same base model, but also to controllable generation using existing controllable tools. With the benefit of the decoupled cross-attention strategy, the image prompt can also work well with the text prompt to achieve multimodal image generation. The project page is available at \url{https://ip-adapter.github.io}.

研究动机与目标

  • 在不微调基础扩散模型的情况下实现图像提示生成。
  • 设计一个轻量级适配器,在保留文本到图像能力的同时融入图像提示。
  • 实现对来自同一基础模型的自定义模型的强泛化,并兼容诸如 ControlNet 等可控工具。
  • 展示通过将图像提示与文本提示结合实现多模态提示。

提出的方法

  • 添加一个图像编码器(CLIP image encoder)以产生全局图像嵌入。
  • 引入解耦的跨注意力:在每个 UNet 的 cross-attention 处为图像特征添加一个新的 cross-attention 层,具有可训练的 K/V 投影。
  • 使用 text-K/V 来初始化 image-K/V 投影以加速收敛,并仅训练 adapter 参数(~22M total)。
  • 使用相同的扩散目标 L_simple 进行训练,对文本 c_t 和图像 c_i 做条件;随机丢弃图像/文本提示以实现 classifier-free 指引。
  • 推理时,可选地用参数 lambda 权衡图像与文本引导,以平衡多模态提示。
  • 展示与现有可控适配器(如 ControlNet)兼容,而无需修改基础扩散模型。

实验结果

研究问题

  • RQ1在不微调基础模型的情况下,是否可以将图像提示整合到预训练的文本到图像扩散模型中?
  • RQ2解耦跨注意力设计是否比简单特征拼接或其他适配器提供更好的图像提示保真度?
  • RQ3IP-Adapter 是否可在来自同一基础模型的自定义模型上重复使用并与现有控制工具兼容?
  • RQ4图像提示是否能有效地与文本提示结合以实现多模态生成?

主要发现

  • 一个 22M 参数的 IP-Adapter 在结果上可比甚至优于一些完全微调的图像提示模型。
  • 解耦跨注意力设计优于简单的将图像特征拼接到 cross-attention 的适配器。
  • IP-Adapter 可在来自同一基础模型的自定义模型上重复使用,并保持与 ControlNet 等可控工具的兼容。
  • 该方法支持多模态提示,便于在生成中平衡使用图像和文本条件。
  • COCO 的定量结果显示 IP-Adapter 超过了若干适配器,并且达到或超过某些微调基线(CLIP-T 和 CLIP-I 指标)。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。