Diffusion models (DMs) synthesize high-quality images in various domains. However, controlling their generative process is still hazy because the intermediate variables in the process are not rigorously studied. Recently, StyleCLIP-like editing of DMs is found in the bottleneck of the U-Net, named $h$-space. In this paper, we discover that DMs inherently have disentangled representations for content and style of the resulting images: $h$-space contains the content and the skip connections convey the style. Furthermore, we introduce a principled way to inject content of one image to another considering progressive nature of the generative process. Briefly, given the original generative process, 1) the feature of the source content should be gradually blended, 2) the blended feature should be normalized to preserve the distribution, 3) the change of skip connections due to content injection should be calibrated. Then, the resulting image has the source content with the style of the original image just like image-to-image translation. Interestingly, injecting contents to styles of unseen domains produces harmonization-like style transfer. To the best of our knowledge, our method introduces the first training-free feed-forward style transfer only with an unconditional pretrained frozen generative network. The code is available at https://curryjung.github.io/DiffStyle/.
翻译:扩散模型(DM)能够在各个领域中合成高质量的图像。然而,控制它们的生成过程仍然模糊不清,因为过程中的中间变量还没有被严格研究。最近,在U-Net的瓶颈中发现了StyleCLIP-like对DM的编辑,称为$h$-space。在本文中,我们发现DM固有地具有结果图像的内容和风格的解缠表示:$h$-space包含内容,跳过连接传递风格。此外,我们介绍了一种原则性的方法,可以考虑到生成过程的渐进性,将一个图像的内容注入到另一个图像中。简而言之,给定原始生成过程,1)应逐渐混合源内容的特征,2)混合特征应被归一化以保留其分布,3)由于内容注入而产生的跳过连接的变化应得到校准。然后,生成的图像具有原始图像的风格和源内容,就像图像到图像的转换一样。有趣的是,将内容注入到未见过领域的风格中会产生类似于协调的风格迁移。据我们所知,我们的方法是首个使用无条件预先训练的冻结生成网络只进行前向传递风格迁移的训练免费方法。该代码已在https://curryjung.github.io/DiffStyle/上提供。