arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2409.02097cs.CVcs.LG
收藏

LinFusion:1 GPU,1分钟,16K图像

LinFusion: 1 GPU, 1 Minute, 16K Image

National University of Singapore(新加坡国立大学)

Songhua Liu, Weihao Yu, Zhenxiong Tan, Xinchao Wang

AI总结:

本文提出LinFusion,一种基于广义线性注意力范式的扩散模型,通过注意力归一化和非因果推理增强高分辨率视觉生成,在保持与StableDiffusion相当性能的同时显著降低时空复杂度,支持单GPU生成16K图像且兼容现有SD组件。

摘要:

现代扩散模型,特别是那些利用基于Transformer的UNet进行去噪的模型,严重依赖自注意力操作来管理复杂的空间关系,从而取得了令人印象深刻的生成性能。然而,由于这种现有范式在时间和内存复杂度上相对于空间token数量呈二次方关系,在生成高分辨率视觉内容时面临重大挑战。为了解决这一局限性,本文旨在提出一种新颖的线性注意力机制作为替代方案。具体而言,我们从最近引入的具有线性复杂度的模型(例如Mamba2、RWKV6、Gated Linear Attention等)开始探索,并确定了两个关键特征——注意力归一化和非因果推理——它们能够增强高分辨率视觉生成性能。基于这些见解,我们引入了一种广义线性注意力范式,作为对广泛流行的线性token混合器的低秩近似。为了节省训练成本并更好地利用预训练模型,我们初始化模型并从预训练的StableDiffusion (SD) 中蒸馏知识。我们发现,经过适度训练后,被称为LinFusion的蒸馏模型实现了与原始SD相当或更优的性能,同时显著降低了时间和内存复杂度。在SD-v1.5、SD-v2.1和SD-XL上的大量实验表明,LinFusion能够实现令人满意且高效的零样本跨分辨率生成,可在单个GPU上处理16K等超高分辨率图像。此外,它与预训练的SD组件和流水线(如ControlNet、IP-Adapter、DemoFusion、DistriFusion等)高度兼容,无需任何适配工作。代码可在https://github.com/Huage001/LinFusion获取。

英文摘要:

Modern diffusion models, particularly those utilizing a Transformer-based UNet for denoising, rely heavily on self-attention operations to manage complex spatial relationships, thus achieving impressive generation performance. However, this existing paradigm faces significant challenges in generating high-resolution visual content due to its quadratic time and memory complexity with respect to the number of spatial tokens. To address this limitation, we aim at a novel linear attention mechanism as an alternative in this paper. Specifically, we begin our exploration from recently introduced models with linear complexity, e.g., Mamba2, RWKV6, Gated Linear Attention, etc, and identify two key features--attention normalization and non-causal inference--that enhance high-resolution visual generation performance. Building on these insights, we introduce a generalized linear attention paradigm, which serves as a low-rank approximation of a wide spectrum of popular linear token mixers. To save the training cost and better leverage pre-trained models, we initialize our models and distill the knowledge from pre-trained StableDiffusion (SD). We find that the distilled model, termed LinFusion, achieves performance on par with or superior to the original SD after only modest training, while significantly reducing time and memory complexity. Extensive experiments on SD-v1.5, SD-v2.1, and SD-XL demonstrate that LinFusion enables satisfactory and efficient zero-shot cross-resolution generation, accommodating ultra-resolution images like 16K on a single GPU. Moreover, it is highly compatible with pre-trained SD components and pipelines, such as ControlNet, IP-Adapter, DemoFusion, DistriFusion, etc, requiring no adaptation efforts. Codes are available at https://github.com/Huage001/LinFusion.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑