Generative transformers have shown their superiority in synthesizing high-fidelity and high-resolution images, such as good diversity and training stability. However, they suffer from the problem of slow generation since they need to generate a long token sequence autoregressively. To better accelerate the generative transformers while keeping good generation quality, we propose Lformer, a semi-autoregressive text-to-image generation model. Lformer firstly encodes an image into $h{\times}h$ discrete tokens, then divides these tokens into $h$ mirrored L-shape blocks from the top left to the bottom right and decodes the tokens in a block parallelly in each step. Lformer predicts the area adjacent to the previous context like autoregressive models thus it is more stable while accelerating. By leveraging the 2D structure of image tokens, Lformer achieves faster speed than the existing transformer-based methods while keeping good generation quality. Moreover, the pretrained Lformer can edit images without the requirement for finetuning. We can roll back to the early steps for regeneration or edit the image with a bounding box and a text prompt.
翻译:生成式Transformer在合成高保真、高分辨率图像方面展现出优越性,例如良好的多样性和训练稳定性。然而,由于需要自回归地生成长序列的令牌,其生成速度较慢。为了在保持良好生成质量的同时加速生成式Transformer,我们提出了Lformer——一种半自回归文本到图像生成模型。Lformer首先将图像编码为$h{\times}h$个离散令牌,然后将这些令牌从左上到右下划分为$h$个镜像的L形块,并在每一步中并行解码块内的令牌。Lformer与自回归模型类似地预测紧邻先前上下文的区域,因此在加速过程中更加稳定。通过利用图像令牌的二维结构,Lformer在保持良好生成质量的同时,实现了比现有基于Transformer的方法更快的速度。此外,预训练的Lformer无需微调即可进行图像编辑。我们可以回滚到早期步骤进行重新生成,或通过边界框和文本提示对图像进行编辑。