An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
DiffiT : Diffusion V ision Transformers for Image Generation
OminiControl: Minimal and Universal Control for Diffusion Transformer
为什么需要提出OminiControl,Omini解决了哪些现有问题?
在现有工作中,生成高质量图像并且实现精确的用户控制仍然是核心挑战,现有工作仍然存在细粒度控制(fine-grained control)问题,并且缺乏生成指定控制的确切空间细节和视觉属性的能力。
虽然已有工作尝试克服这一局限性,但是仍存在以下问题:
Leveraging existing architecture
利用现有架构,复用DiT中的VAE编码器,将conditioning image投影到与noisy image相同的latent space中,没有引入额外的模块,降低架构复杂性。
Unified sequence processing
统一序列处理,直接将 condition tokens 与 noisy image tokens 拼接在一起,并通过多模态注意力(multi-modal attention)进行处理。实现了各个 tokens 之间的灵活交互,允许tokens之间直接建立关系,而不施加刚性的空间约束。相比于直接的 image condition 相加到noisy image,提高了空间的灵活性。
Position-aware token interaction
位置感知的token交互。在Flux中的RoPE为每个token分配位置索引,用于保持位置信息。Omini根据控制任务的不同为空间对齐和非对齐任务的condition image tokens $C_I$ 分配不同的位置索引,提出了一种动态定位策略:
对于空间对齐任务,condition tokens与noisy image tokens共享位置信息,以实现空间对齐。对于非空间对齐任务,将 condition tokens 通过 $\triangle$ 进行偏移,减少与$X$的空间重叠。并且对于非对齐任务可以得到更快的收敛速度。
Controllable conditioning strength
可控条件强度。在多模态注意力计算中引入一个偏置项来实现对于条件的影响强度。其中 $\gamma$ 是强度因子,$B(\gamma)$是偏置矩阵。
InstantStyle: Free Lunch towards Style-Preserving in Text-to-Image Generation
当前工作存在的一些问题:
Separating Content from Image
使用CLIP的text encoder来提取参考图像的内容特征作为内容表示,使用CLIP的image encoder 来提取参考图像总体特征。用图像特征减去内容文本特征得到风格特征,从而实现风格与内容的解耦。
Injecting into Style Blocks Only
up blocks.0.attentions.1 捕捉风格(颜色、材质、氛围),down blocks.2.attentions.1 捕捉空间布局(结构、构图)
将参考图像特征仅注入到这些 block 中,从而实现风格迁移
The goal of style transfer, or stylized image generation, is to apply the specific style from a given reference image or subset to a target content image. The multifaceted attribute of style makes it difficult to collect stylized datasets, represent style accurately, and evaluate the success of the transfer.
对于风格迁移任务的数据集构建,以及风格迁移的评估问题仍然待解决。InstantStyle这篇论文中,最后的结果分析都是主观的非量化分析,风格迁移的评估问题值得关注。
风格迁移问题解决思路的脉络:fine-tuning diffusion models –> tuning-free approaches for stylized image generation
对于 tuning-free 的风格迁移分为:
Some approaches aim to address this by constructing paired datasets where the same object is represented in multiple styles, facilitating the extraction of disentangled style and content representations.
数据集构建实现风格解耦的一种思路
Don’t forget that CLIP’s feature space has good compatibility, and features in the same feature space can be added and subtracted.
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
为什么要提出该工作,当下有哪些问题待解决?
T2I diffusion models 需要复杂的 text prompt 来生成理想图像,并且 text prompt 信息量有限
image prompt 可作为新的 prompt 来指导图像生成,但是现有方法直接基于预训练模型进行微调,需要大量的计算资源,并且与其他基础模型、文本提示和结构化控制不兼容。
也有工作通过使用额外结构控制(如用户绘制的草图、深度图、语义分割图等)和简单的 adapter 来进行图像生成。
具体来说就是把image prompt 通过CLIP image encoder 和一个可训练网络映射到新特征,与文本特征拼接,进而引导图像生成。但是效果不如微调后的模型
Image Encoder
使用CLIP的image encoder提取出image prompt的image embedding,经过一个可训练的投影网络,将image embedding 投影到 image feature,与text feature维度相同。
Decoupled Cross-Attention
解耦cross-attention机制,将 text feature 和 image feature 的 cross-attention 分开,在 Unet 中的 cross-attention layer添加一个新的 cross-attention layer,用于插入图像特征
对于text prompt 的cross-attention,其中$Q=ZW_q,K=c_tW_k,V=c_tW_v$
对于image prompt 的 cross-attention,其中$Q=ZW_q,K^{\prime}=c_iW_k^{\prime},V^{\prime}=c_iW_v^{\prime}$
Training and Inference
在推理阶段通过权重因子 $\lambda$ 调整图像条件的权重
对于主题驱动任务难以解决,无法保持 subject 的一致性
DEADiff: An Efficient Stylization Diffusion Model with Disentangled Representations
现有的 encoder-based 方法在风格迁移时会削弱 T2I models 的文本可控性
Dual Decoupling Representation Extraction
双解耦表征提取。首先是风格表征提取(STRE),选择风格相同但是内容不同的图像对。使用 Q-Former 作为表征过滤器,解耦图像中的风格和内容表征。参考图像特征经过Q-Former处理后输出,结合描述目标图像内容的文本特征输入到Unet中作为条件指导图像生成。接着内容表征提取(SERE),选择风格不同但是内容相同的图像对。将Q-Former的输入文本替换为”content”以提取内容相关表征,再将Q-Former输出的 query tokens 与目标图像的风格文本提示共同作为去噪U-Net的条件。如图2(a)所示。同时,在整体流程中也会引入 reconstruction 任务,同时使用”style”Q-Former与”content”Q-Former共同处理处理 query tokens,从而确保 Q-Foemer 不会丢失图像信息。
Disentangled Conditioning Mechanism
解耦条件注入机制 (DCM)。将语义条件注入空间分辨率较低的粗粒度层,而将风格条件注入空间分辨率较高的细粒度层。设计了 joint text-image crossattention layer 用于实现 Unet 对于图像特征条件的支持
Paired Datasets Construction
配对数据集构建。对于风格表征学习任务,选择同一提示生成的两张不同图像作为参考与目标(如图2(a)图像对A);对于内容表征学习任务,选取相同主体词但不同风格词的图像对(如图2(b))。
DiT4Edit: Diffusion Transformer for Image Editing
Scalable Diffusion Models with Transformers