让自回归模型像扩散模型一样精准控图,还更高效。
ControlAR: Controllable Image Generation with Autoregressive Models
- 用轻量编码器把边缘、深度等控制图转成控制令牌
- 通过条件解码提升控制力,生成质量超越现有方法
- 支持任意分辨率生成,适合需要精细控制的视觉任务
自回归(AR)模型将图像生成重构为逐令牌预测,展现出与扩散模型相媲美的潜力。然而,类似ControlNet的可控图像生成在AR模型中仍属空白。虽然可借鉴大语言模型思路,将控制图像分块为令牌并前置填充,但生成质量仍逊于ControlNet且效率低下。为此,我们提出ControlAR——一种高效且有效的自回归图像生成控制框架。首先,探索了适用于AR模型的控制编码方式,提出轻量级控制编码器,将边缘、深度图等空间输入转换为控制令牌;其次,采用条件解码机制,使每个图像令牌的生成同时依赖于控制与图像令牌的逐令牌融合,类似位置编码。相比前置填充,该方法显著增强控制能力且保持高效。此外,该框架意外实现基于条件解码的任意分辨率图像生成。大量实验表明,ControlAR在边缘、深度、语义分割等多种控制输入下均具备强可控性,定量与定性结果均显示其优于当前最优可控扩散模型(如ControlNet++)。代码、模型与演示即将开源。
原文摘要 · Abstract (English)
Autoregressive (AR) models have reformulated image generation as next-token prediction, demonstrating remarkable potential and emerging as strong competitors to diffusion models. However, control-to-image generation, akin to ControlNet, remains largely unexplored within AR models. Although a natural approach, inspired by advancements in Large Language Models, is to tokenize control images into tokens and prefill them into the autoregressive model before decoding image tokens, it still falls short in generation quality compared to ControlNet and suffers from inefficiency. To this end, we introduce ControlAR, an efficient and effective framework for integrating spatial controls into autoregressive image generation models. Firstly, we explore control encoding for AR models and propose a lightweight control encoder to transform spatial inputs (e.g., canny edges or depth maps) into control tokens. Then ControlAR exploits the conditional decoding method to generate the next image token conditioned on the per-token fusion between control and image tokens, similar to positional encodings. Compared to prefilling tokens, using conditional decoding significantly strengthens the control capability of AR models but also maintains the model's efficiency. Furthermore, the proposed ControlAR surprisingly empowers AR models with arbitrary-resolution image generation via conditional decoding and specific controls. Extensive experiments can demonstrate the controllability of the proposed ControlAR for the autoregressive control-to-image generation across diverse inputs, including edges, depths, and segmentation masks. Furthermore, both quantitative and qualitative results indicate that ControlAR surpasses previous state-of-the-art controllable diffusion models, e.g., ControlNet++. Code, models, and demo will soon be available at https://github.com/hustvl/ControlAR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。