INFINITYGAN: TOWARDS INFINITE-PIXEL IMAGE SYNTHESIS
Year: 2021

Abstract:
We present a novel framework, InfinityGAN, for arbitrary-sized image generation. The task is associated with several key challenges. First, scaling existing models to an arbitrarily large image size is resource-constrained, in terms of both computation and availability of large-field-of-view training data. InfinityGAN trains and infers in a seamless patch-by-patch manner with low computational resources. Second, large images should be locally and globally consistent, avoid repetitive patterns, and look realistic. To address these, InfinityGAN disentangles global appearances, local structures, and textures. With this formulation, we can generate images with spatial size and level of details not attainable before. Experimental evaluation validates that InfinityGAN generates images with superior realism compared to baselines and features parallelizable inference. Finally, we show several applications unlocked by our approach, such as spatial style fusion, multimodal outpainting, and image inbetweening. All applications can be operated with arbitrary input and output sizes.

heading: 1 INTRODUCTION
text: Generative models witness substantial improvements in resolution and level of details. Most improvements come at a price of increased training time (Gulrajani et al., 2017; Mescheder et al., 2018), larger model size (Balaji et al., 2021), and stricter data requirements (Karras et al., 2018). The most recent works synthesize images at 1024×1024 resolution featuring a high level of details and fidelity. However, models generating high resolution images usually still synthesize images of
All codes, datasets, and trained models will be made publicly available.
limited field-of-view bounded by the training data. It is not straightforward to scale these models to generate images of arbitrarily large field-of-view. Synthesizing infinite-pixel images is constrained by the finite nature of resources. Finite computational resources (e.g., memory and training time) set bounds for input receptive field and output size. A further limitation is that there exists no infinitepixel image dataset. Thus, to generate infinite-pixel images, a model should learn the implicit global structure without direct supervision and under limited computational resources.
Repetitive texture synthesis methods (Efros & Leung, 1999; Xian et al., 2018) generalize to large spatial sizes. Yet, such methods are not able to synthesize real-world images. Recent works, such as SinGAN (Shaham et al., 2019) and InGAN (Shocher et al., 2019), learn an internal patch distribution for image synthesis. Although these models can generate images with arbitrary shapes, in Section 4.1, we show that they do not infer structural relationships well, and fail to construct plausible holistic views with spatially extended latent space. A different approach, COCO-GAN (Lin et al., 2019), learns a coordinate-conditioned patch distribution for image synthesis. As shown in Figure 4, despite the ability to slightly extend images beyond the learned boundary, it fails to maintain the global coherence of the generated images when scaling to a 2× larger generation size. How to generate infinite-pixel images? Humans are able to guess the whole scene given a partial observation of it. In a similar fashion, we aim to build a generator that trains with image patches, and inference images of unbounded arbitrary-large size. An example of a synthesized scene containing globally-plausible structure and heterogeneous textures is shown in Figure 1.
We propose InfinityGAN, a method that trains on a finite-pixel dataset, while generating infinitepixel images at inference time. InfinityGAN consists of a neural implicit function, termed structure synthesizer, and a padding-free StyleGAN2 generator, dubbed texture synthesizer. Given a global appearance of an infinite-pixel image, the structure synthesizer samples a sub-region using coordinates and synthesizes an intermediate local structural representations. The texture synthesizer then seamlessly synthesizes the final image by parts after filling the fine local textures to the local structural representations. InfinityGAN can infer a compelling global composition of a scene with realistic local details. Trained on small patches, InfinityGAN achieves high-quality, seamless and arbitrarily-sized outputs with low computational resources—a single TITAN X to train and test.
We conduct extensive experiments to validate the proposed method. Qualitatively, we present the everlastingly long landscape images. Quantitatively, we evaluate InfinityGAN and related methods using user study and a proposed ScaleInv FID metric. Furthermore, we demonstrate the efficiency and efficacy of the proposed methods with several applications. First, we demonstrate the flexibility and controllability of the proposed method by spatially fusing structures and textures from different distributions within an image. Second, we show that our model is an effective deep image prior for the image outpainting task with the image inversion technique and achieves multi-modal outpainting of arbitrary length from arbitrarily-shaped inputs. Third, with the proposed model we can divide-and-conquer the full image generation into independent patch generation and achieve 7.2× of inference speed-up with parallel computing, which is critical for high-resolution image synthesis.

heading: 2 RELATED WORK
text: Latent generative models. Existing generative models are mostly designed to synthesize images of fixed sizes. A few methods (Karras et al., 2018; 2020) have been recently developed to train latent generative models on high-resolution images, up to 1024×1024 pixels. However, latent generative models generate images from dense latent vectors that require synthesizing all structural contents at once. Bounded by computational resources and limited by the learning framework and architecture, these approaches synthesize images of certain sizes and are non-trivial to generalize to different output size. In contrast, patch-based GANs trained on image patches (Lin et al., 2019; Shaham et al., 2019; Shocher et al., 2019) are less constrained by the resource bottleneck with the synthesis-by-part approach. However, (Shaham et al., 2019; Shocher et al., 2019) can only model and repeat internal statistics of a single image, and (Lin et al., 2019) can barely extrapolate few patches beyond the training size. ALIS (Skorokhodov et al., 2021) is a concurrent work that also explores synthesizing infinite-pixel images. It recursively inbetweens latent variable pairs in the horizontal direction. We further discuss the method in Appendix A.1. Finally, autoregressive models (Oord et al., 2016; Razavi et al., 2019; Esser et al., 2021) can theoretically synthesize at arbitrary image sizes. Despite (Razavi et al., 2019) and (Esser et al., 2021) showing unconditional images synthesis at 1024×1024 resolution, their application in infinite-pixel image synthesis has not yet been well-explored.
Conditional generative models. Numerous tasks such as image super-resolution, semantic image synthesis, and image extrapolation often showcase results over 1024×1024 pixels. These tasks are less related to our setting, as most structural information is already provided in the conditional inputs. We illustrate and compare the characteristics of these tasks against ours in Appendix B. Image outpainting. Image outpainting (Abdal et al., 2020; Liu et al., 2021; Sabini & Rusak, 2018; Yang et al., 2019) is related to image inpainting (Liu et al., 2018a; Yu et al., 2019) and shares similar issues that the generator tends to copy-and-paraphrase the conditional input or create mottled textural samples, leading to repetitive results especially when the outpainted region is large. InOut (Cheng et al., 2021) proposes to outpaint image with GANs inversion and yield results with higher diversity. We show that with InfinityGAN as the deep image prior along with InOut (Cheng et al., 2021), we obtain the state-of-the-art outpainting results and avoids the need of sequential outpainting. Then, we demonstrate applications in arbitrary-distant image inbetweening, which is at the intersection of image inpainting (Liu et al., 2018a; Nazeri et al., 2019; Yu et al., 2019) and outpainting research. Neural implicit representation. Neural implicit functions (Park et al., 2019; Mescheder et al., 2019; Mildenhall et al., 2020) have been applied to model the structural information of 3D and continuous representations. Adopting neural implicit modeling, our query-by-coordinate synthesizer is able to model structural information effectively. Some recent works (DeVries et al., 2021; Niemeyer & Geiger, 2021; Chan et al., 2021) also attempt to integrate neural implicit function into generative models, but aiming at 3D-structure modeling instead of extending the synthesis field-of-view.

heading: 3 PROPOSED METHOD

heading: 3.1 OVERVIEW
text: An arbitrarily large image can be described globally and locally. Globally, images should be coherent and hence global characteristics should be expressible by a compact holistic appearance (e.g., a medieval landscape, ocean view panorama). Therefore, we adopt a fixed holistic appearance for each infinite-pixel image to represent the high-level composition and content of the scene. Locally, a close-up view of an image is defined by its local structure and texture. The structure represents objects, shapes and their arrangement within a local region. Once the structure is defined, there exist multiple feasible appearances or textures to render realistic scenes. At the same time, structure and texture should conform to the global holistic appearance to maintain the visual consistency among the neighboring patches. Given these assumptions, we can generate an infinite-pixel image by first sampling a global holistic appearance, then spatially extending local structures and textures following the holistic appearance.
Accordingly, the InfinityGAN generator G consists of a structure synthesizer GS and a texture synthesizer GT. GS is an implicit function that samples a sub-region with coordinates and creates local structural features. GT is a fully convolutional StyleGAN2 (Karras et al., 2020) modeling textural properties for local patches and rendering final image. Both modules follow a consistent holistic appearance throughout the process. Figure 2 presents the overview of our framework.
3.2 STRUCTURE SYNTHESIZER (GS) Structure synthesizer is a neural implicit function driven by three sets of latent variables: A global latent vector zg representing the holistic appearance of the infinite-pixel image (also called implicit image since the whole image is never explicitly sampled), a local latent tensor zl expressing the local structural variation of the image content, and a coordinate grid c specifying the location of the patches to sample from the implicit image. The synthesis process is formulated as:
zS = GS(zg, zl, c), (1) where zS denotes the structural latent variable that is later used as an input to the texture synthesizer.
We sample zg ∈ RDzg from a unit Gaussian distribution once and inject zg into every layer and pixel in GS via feature modulation (Huang & Belongie, 2017; Karras et al., 2020). As local variations are independent across the spatial dimension, we independently sample them from a unit Gaussian prior for each spatial position of zl ∈ RH×W×Dzl , where H and W can be arbitrarily extended. We then use coordinate grid c to specify the location of the target patches to be sampled. To be able to conditionGS with coordinates infinitely far from the origin, we introduce a prior by exploiting the nature of landscape images: (a) self-similarity for the horizontal direction, and (b) rapid saturation (e.g., land, sky or ocean) for the vertical direction. To implement this, we use the positional encoding for the horizontal axis similar to (Vaswani et al., 2017; Tancik et al., 2020; Sitzmann et al., 2020). We use both sine and cosine functions to encode each coordinate for numerical stability. For the vertical axis, to represent saturation, we apply the tanh function. Formally, given horizontal and vertical indexes (ix, iy) of zl tensor, we encode them as c = (tanh(iy), cos(ix/T ), sin(ix/T )) , where T is the period of the sine function and c controls the location of the patch to generate.
To prevent the model from ignoring the variation of zl and generating repetitive content by following the periodically repeating coordinates, we adopt a mode-seeking diversity loss (Mao et al., 2019) between a pair of local latent variables zl1 and zl2 while sharing the same zg and c:
Ldiv = ‖zl1 − zl2‖1 / ‖GS(zg, zl1 , c)−GS(zg, zl2 , c)‖1 . (2)
Conventional neural implicit functions produce outputs for each input query independently, which is a pixel in zl for InfinityGAN. Such a design causes training instabilities and slows convergence, as we show in Figure 37. We therefore adopt the feature unfolding technique (Chen et al., 2021) to enable GS to account for the information in a broader neighboring region of zl and c, introducing a larger receptive field. For each layer in GS, before feeding forward to the next layer, we apply a k × k feature unfolding transformation at each location (i, j) of the origin input f to obtain the unfolded input f ′: f ′(i,j) = Concat({f(i+ n, j +m)}n,m∈{−k/2,k/2}) , (3) where Concat(·) concatenates the unfolded vectors in the channel dimension. In practice, as the gridshaped zl and c are sampled with equal spacing between consecutive pixels, the feature unfolding can be efficiently implemented with CoordConv (Liu et al., 2018b).
3.3 TEXTURE SYNTHESIZER (GT) Texture synthesizer aims to model various realizations of local texture given the local structure zS generated by the structure synthesizer. In addition to the holistic appearance zg and the local structural latent zS, texture synthesizer uses noise vectors zn to model the finest-grained textural variations that are difficult to capture by other variables. The generation process can be written as:
pc = GT(zS, zg, zn) , (4) where pc is a generated patch at location c (i.e., the c used in Eq 1 for generating zS).
We implement upon StyleGAN2 (Karras et al., 2020). First, we replace the fixed constant input with the generated structure zS. Similar to StyleGAN2, randomized noises zn are added to all layers of GT, representing the local variations of fine-grained textures. Then, a mapping layer projects zg to a style vector, and the style is injected into all pixels in each layer via feature modulation. Finally, we remove all zero-paddings from the generator, as shown in Figure 3(b).
Both zero-padding and GS can provide positional information to the generator, and we later show that positional information is important for generator learning in Section 4.2. However, it is necessary to remove all zero-paddings from GT for three major reasons. First, zero-padding has a consistent pattern during training, due to the fixed training image size. Such a behavior misleads
the generator to memorize the padding pattern, and becomes vulnerable to unseen padding patterns while attempting to synthesize at a different image size. The third column of Figure 4 shows when we extend the input latent variable of the StyleGAN2 generator multiple times, the center part of the features does not receive expected coordinate information from the paddings, resulting in extensively repetitive textures in the center area of the output image. Second, zero-paddings can only provide positional information within a limited distance from the image border. However, while generating infinite-pixel images, the image border is considered infinitely far from the generated patch. Finally, as shown in Figure 3, the existence of paddings hampers GT from generating separate patches that can be composed together. Therefore, we remove all paddings from GT, facilitating the synthesisby-parts of arbitrary-sized images. We refer to the proposed GT as a padding-free generator (PFG).

heading: 3.4 SPATIALLY INDEPENDENT GENERATION
text: InfinityGAN enables spatially independent generation thanks to two characteristics of the proposed modules. First, GS, as a neural implicit function, naturally supports independent inference at each spatial location. Second, GT, as a fully convolutional generator with all paddings removed, can synthesize consistent pixel values at the same spatial location in the implicit image, regardless of different querying coordinates, as shown in Figure 3(b). With these properties, we can independently query and synthesize a patch from the implicit image, seamlessly combine multiple patches into an arbitrarily large image, and maintain constant memory usage while synthesizing images of any size.
In practice, having a single center pixel in a zS slice that aligns to the center pixel of the corresponding output image patch can facilitate zl and c indexing. We achieve the goal by shrinking the StyleGAN2 blur kernel size from 4 to 3, causing the model to generate odd-sized features in all layers, due to the convolutional transpose layers.

heading: 3.5 MODEL TRAINING
text: The discriminator D of InfinityGAN is similar to the one in the StyleGAN2 method. The detailed architectures of G and D are presented in Appendix D. The two networks are trained with the nonsaturating logistic loss Ladv (Goodfellow et al., 2014), R1 regularization LR1 (Mescheder et al., 2018) and path length regularization Lpath (Karras et al., 2020). Furthermore, to encourage the generator to follow the conditional distribution in the vertical direction, we train G and D with an auxiliary task (Odena et al., 2017) predicting the vertical position of the patch:
Lar = ‖ĉy − c̄y‖1 , (5) where ĉy is the vertical coordinate predicted by D, and c̄y is either (for generated images) cy = tanh(iy) or (for real images) the vertical position of the patch in the full image. We formulate Lar as a regression task. The overall loss function for the InfinityGAN is:
min D Ladv + λarLar + λR1LR1 , min G − Ladv + λarLar + λdivLdiv + λpathLpath , (6)
where λ’s are the weights.

heading: 4 EXPERIMENTAL RESULTS
text: Datasets. We evaluate the ability of synthesizing at extended image sizes on the Flickr-Landscape dataset consists of 450,000 high-quality landscape images, which are crawled from the Landscape group on Flickr. For the image outpainting experiments, we evaluate with other baseline methods on scenery-related subsets from the Place365 (Zhou et al., 2017) (62,500 images) and FlickrScenery (Cheng et al., 2021) (54,710 images) datasets. Note that the Flickr-Scenery here is different from our Flickr-Landscape. For image outpainting task, we split the data into 80%, 10%, 10% for training, validation, and test. All quantitative and qualitative evaluations are conducted on test set.
Hyperparameters. We use λar = 1, λdiv = 1, λR1 = 10, and λpath = 2 for all datasets. All models are trained with 101×101 patches cropped from 197×197 real images. Since our InfinityGAN synthesizes odd-sized images, we choose 101 that maintains a sufficient resolution that humans can still recognize its content. On the other hand, 197 is the next output resolution if stacking another upsampling layer to InfinityGAN, which also provides 101×101 patches a sufficient field-of-view. We adopt the Adam (Kingma & Ba, 2015) optimizer with β1 = 0, β2 = 0.99 and a batch size 16 for 800,000 iterations. More details are presented in Appendix C.
Metrics. We first evaluate Fréchet Inception Distance (FID) (Heusel et al., 2017) at G training resolution. Then, without access to real images at larger sizes, we assume that the real landscape with a larger FoV will share a certain level of self-similarity with its smaller FoV parts. We accordingly propose a ScaleInv FID, which resizes larger images to the training data size with bilinear interpolation, then computes FID. We denote N× ScaleInv FID when the metric is evaluated with images N× larger than the training samples. Evaluated Method. We perform the evaluation on Flickr-Landscape with the following algorithms:
− SinGAN. We train an individual SinGAN model for each image. The images at larger sizes are generated by setting spatially enlarged input latent variables. Note that we do not compare with the super-resolution setting from SinGAN since we focus on extending the learned structure rather than super-resolve the high-frequency details.
− COCO-GAN. Follow the “Beyond-Boundary Generation” protocol of COCO-GAN, we transfer a trained COCO-GAN model to extended coordinates with a post-training procedure. − StyleGAN2 (+NCI). We replace the constant input of the original StyleGAN2 with a zl of the same shape, we call such a replacement as “non-constant input (NCI)”. This modification enables StyleGAN2 to generate images at different output sizes with different zl sizes.

heading: 4.1 GENERATION AT EXTENDED SIZE.
text: Additional (unfair) protocols for fairness. We adopt two additional pre- and post-processing to ensure that InfinityGAN does not take advantage of its different training resolution. To ensure InfinityGAN is trained with the same amount of information as other methods, images are first bilinear interpolated into 128×128 before resized into 197×197. Next, for all testing sizes in Table 4, InfinityGAN generates at 1.54× (=197/128) larger size to ensure final output images share the same FoV with others. In fact, these corrections make the setting disadvantageous for InfinityGAN, as it is trained with patches of 50% FoV, generates 54% larger images for all settings, and requires to composite multiple patches for its 1× ScaleInv FID. Quantitative analysis. For all the FID metrics in Table 1, unfortunately, the numbers are not directly comparable, since InfinityGAN is trained with patches with smaller FoV and at a different resolution. Nevertheless, the trend in ScaleInv FID is informative. It reflects the fact that the global structures generated from the baselines drift far away from the real landscape as the testing FoV enlarges. Meanwhile, InfinityGAN maintains a more steady slope, and surpasses the strongest baseline after 4× ScaleInv FID. Showing that InfinityGAN indeed performs favorably better than all baselines as the testing size increases.
Qualitative results. In Figure 4, we show that all baselines fall short of creating reasonable global structures with spatially expanded input latent variables. COCO-GAN is unable to transfer to new coordinates when the extrapolated coordinates are too far away from the training distribution. Both SinGAN and StyleGAN2 implicitly establish image features based on position encoded by zero padding, assuming the training and testing position encoding should be the same. However, when synthesizing at extended image sizes, the inevitable change in the spatial size of the input and the features leads to drastically different position encoding in all model layers. Despite the models can still synthesize reasonable contents near the image border, where the position encoding is still partially correct, they fail to synthesize structurally sound content in the image center. Such a result causes ScaleInv FID to rapidly surge as the extended generation size increases to 1024×1024. Note that at the 16× setting, StyleGAN2 runs out of memory with a batch size of 1 and does not generate any result. In comparison, InfinityGAN achieves reasonable global structures with fine details. Note that the 1024×1024 image from InfinityGAN is created by compositing 121 independently synthesized patches. With the ability of generating consistent pixel values (Section 3.4), the composition is guaranteed to be seamless. We provide more comparisons in Appedix E, a larger set of generated samples in Appendix F, results from models trained at a higher resolution in Appendix G, and a very-long synthesis result in Appendix J.
In Figure 5, we further conduct experiments on LSUN bridge and tower datasets, demonstrating InfinityGAN is applicable on other datasets. However, since the two datasets are object centric with a low view-angle variation in the vertical direction, InfinityGAN frequently fills the top and bottom area with blank padding textures.
In Figure 6, we switch different zl and GT styles (i.e., zg projected with the mapping layer) while sharing the same c. More samples can be found in Appendix I. The results show that the structure
and texture are disentangled and modeled separately by GS and GT. The figure also shows that GS can generate a diverse set of structures realized by different zl.
User study. We use two-alternative forced choice (2AFC) between InfinityGAN and other baselines on the Flickr-Landscape dataset. A total of 50 participants with basic knowledge in computer vision engage the study, and we conduct 30 queries for each participant. For each query, we show two separate grids of 16 random samples from each of the comparing methods and ask the participant to select “the one you think is more realistic and overall structurally plausible.” As presented in Table 1, the user study shows an over 90% of preference favorable to InfinityGAN against all baselines.

heading: 4.2 ABLATION STUDY: THE POSITIONAL INFORMATION IN GENERATOR
text: As discussed in Section 3.3, we hypothesize that StyleGAN2 highly relies on the positional information from the zero-paddings. In Table 1 and Figure 4, we perform an ablation by removing all paddings from StyleGAN2+NCI, yielding StyleGAN2+NCI+PFG that has no positional information in the generator. The results show that StyleGAN2+NCI+PFG fails to generate reasonable image structures, and significantly degrades in all FID settings. Then, with the proposed GS, the positional information is properly provided from zS, and resumes the generator performance back to a reasonable state.

heading: 4.3 APPLICATIONS
text: Spatial style fusion. Given a single global latent variable zg, the corresponding infinite-pixel image is tied to a single modal of global structures and styles. To achieve greater image diversity and allow the user to interactively generate images, we propose a spatial fusion mechanism that can spatially combine two global latent variables with a smooth transition between them. First, we manually define multiple style centers in the pixel space and then construct an initial fusion map by assigning pixels to the nearest style center. The fusion map consists of one-hot vectors for each pixel, forming a style assignment map. According to the style assignment map, we then propagate the styles in all intermediate layers. Please refer to Appendix L for implementation details. Finally, with the fusion maps annotated for every layer, we can apply the appropriate zg from each style center to each pixel using feature modulation.Note that the whole procedure has a similar inference speed as the normal synthesis. Figure 7 shows synthesized fusion samples.
Outpainting via GAN Inversion. We leverage the pipeline proposed in In&Out (Cheng et al., 2021) to perform image outpainting with latent variable inversion. All loss functions follow the ones proposed in In&Out. We first obtain inverted latent variables that generates an image similar to the given real image via GAN inversion techniques, then outpaint the image by expanding zl and zn with their unit Gaussian prior. See Appendix K for implementation details.
In Table 2, our model performs favorably against all baselines in image outpainting (Boundless (Teterwak et al., 2019), NS-outpaint (Yang et al., 2019), and In&Out (Cheng et al., 2021)).
As shown in Figure 8, while dealing with a large outpainting area (e.g., panorama), all previous outpainting methods adopt a sequential process that generates a fixed region at each step. This introduces obvious concatenation seams, and tends to produce repetitive contents and black regions after the multiple steps. In contrast, with InfinityGAN as the image prior in the pipeline of (Cheng et al., 2021), we can directly outpaint arbitrary-size target region from inputs of arbitrary shape. Moreover, in Figure 9, we show that our outpainting pipeline natively supports multi-modal outpainting by sampling different local latent codes in the outpainting area.
Image inbetweening with inverted latent variables. We show another adaptation of outpainting with model inversion by setting two sets of inverted latent variables at two different spatial locations, then perform spatial style fusion between the variables. Please refer to Appendix K for implementation details. As shown in Figure 10, we can naturally inbetween (Lu et al., 2021) the area between two images with arbitrary distance. A cyclic panorama of arbitrary width can also be naturally generated by setting the same image on two sides.
Parallel batching. The nature of spatial-independent generation enables parallel inference on a single image. As shown in Table 3, by stacking a batch of patches together, InfinityGAN can significantly speed up inference at testing up to 7.20 times. Note that this speed-up is critical for high-resolution image synthesis with a large number of FLOPs.

heading: 5 CONCLUSIONS
text: In this work, we propose and tackle the problem of synthesizing infinite-pixel images, and demonstrate several applications of InfinityGAN, including image outpainting and inbetweening.
Our future work will focus on improving InfinityGAN in several aspects. First, our Flickr-Landscape dataset consists of images taken at different FoVs and distances to the scenes. When InfinityGAN composes landscapes of different scales together, synthesized images may contain artifacts. Second, similar to the FoV problem, some images intentionally include tree leaves on top of the image as a part of the photography composition. These greenish textures cause InfinityGAN sometimes synthesizing trees or related elements in the sky region. Third, there is still a slight decrease in FID score in comparison to StyleGAN2. This may be related to the convergence problem in video synthesis (Tian et al., 2021), in which the generator achieves inferior performance if a preceding network (e.g., the motion module in video synthesis) is jointly trained with the image module.

heading: 6 ETHICS STATEMENT
text: Our work follows the General Ethical Principles listed at ICLR Code of Ethics (https://iclr. cc/public/CodeOfEthics).
The research in generative modeling is frequently accompanied by concerns about the misuse of manipulating or hallucinating information for improper use. Despite none of the proposed techniques aiming at improving manipulation of fine-grained image detail or hallucinating human activities, we cannot rule out the potential of misusing the framework to recreate fake scenery images for any inappropriate application. However, as we do not drastically alter the plausibility of synthesis results in the high-frequency domain, our research is still covered by continuing research in ethical generative modeling and image forensics.

heading: Appendix Table of Contents
text: A Comparisons with Concurrent Work ................................................................................. 15
B Conceptual Comparisons Among Different Tasks............................................................. 17
C Implementation Details of Coordinates .............................................................................. 17
D InfinityGAN Architecture .................................................................................................... 20
E More Comparison with baselines ........................................................................................ 21
F More InfinityGAN Qualitative Results ............................................................................... 22
G InfinityGAN Results At A Higher Resolution .................................................................... 25
H More Results on Other Datasets.......................................................................................... 29
I More Diversity Visualization ............................................................................................... 31
J Our Best Attempt in Including An Everlasting Image...................................................... 32
K Implementation Details of Image Outpainting and Inbetweening via Inversion............ 32
L Implementation Details of Spatial Style Fusion ................................................................. 34
M More Qualitative Results of Outpainting via Inversion .................................................... 36
N More Qualitative Results of Inbetweening via Inversion .................................................. 37
O More Qualitative Results of Cyclic Panoramic Inbetweening via Inversion................... 38
P Experimental Details of The Speed Benchmark with Parallel Batching......................... 39
Q Ablation: Feature Unfolding................................................................................................ 39
R Limitations............................................................................................................................. 40
S Implementation Illustration of ScaleInv FID ..................................................................... 40
T More Comparisons with Texture Synthesis Method ......................................................... 41
U More Comparisons with SinGAN-based Models ............................................................... 41
V Ablation: Mode-Seeking Diversity Loss (Ldiv) .................................................................. 43
W Ablation: Auxiliary Loss (Lar)............................................................................................. 43

heading: A COMPARISONS WITH CONCURRENT WORK
text: A.1 ALIS (SKOROKHODOV ET AL., 2021)
ALIS is a concurrent work that achieves a similar application in infinite-pixel generation by iteratively inbetween pairs of anchor patches. Here, we discuss some of the critical differences.
ALIS has limited ability in extending vertically. InfinityGAN achieves both vertical and horizontal extension while maintaining a plausible holistic appearance. ALIS only presents horizontal extension in the paper. Vertically connecting anchors on any dataset used in their paper will produce invalid structures (e.g., layered landscapes periodically stacking in the sky). Therefore, vertical anchor connection is limited to certain datasets, such as pattern-like textures or satellite images.
Differences in the problem formulation. InfinityGAN directly models each infinite-pixel image with a shared global latent variable using an implicit function. In contrast, ALIS learns to inbetween two independent global latent variables. Furthermore, InfinityGAN can still achieve the inbetweening setup similar to ALIS with spatial style fusion. However, applying ALIS to synthesize images with a shared global context will lead to periodically repeating patches, as shown in Figure 13.
InfinityGAN allows free-form anchor placements without training. ALIS has to designate a constant relative position between the anchors before training starts. It is also non-trivial for ALIS to inbetween multiple anchors. Meanwhile, as shown in Figure 12, our training-free spatial style fusion allows placing any number of anchors at any place. However, the flexibility also comes with a trade-off, our spatial style fusion is not trained with adversarial learning, causing the synthesis performance not compatible to the regularly synthesized images. Following the ALIS evaluation protocol, we train our InfinityGAN on the ALIS LHQ dataset at 256×256 resolution, yielding an FID 11.82 with regular synthesis and an∞-FID 19.22 with spatial style fusion. In contrast, ALIS shows negligible performance gap between FID (10.48) and∞-FID (10.64). Such a result suggest a flexibility-accuracy trade-off between InfinityGAN and ALIS.
ALIS generates blocky and high-frequency lattice artifacts. ALIS adopts the generation-by-parts design from COCO-GAN. As shown in Figure 11, a critical consequence is creating the blocky and lattice artifacts between patches, since the inter-patch continuity is unstably maintained with adversarial learning. In contrast, InfinityGAN is an improved version of COCO-GAN that the interpatch continuity is guaranteed with implicit-function and padding-free generator design.
ALIS still suffers from content repetition. The content repetition problem is discussed in the ALIS paper as a limitation. InfinityGAN addresses the issue with a local latent space and enforces the contribution of the local variables with a diversity loss (2) between zl and zS. We demonstrate that InfinityGAN does not have the content repetition problem in Figure 31.
A.2 MS-PIE (XU ET AL., 2021).
MS-PIE found the positional information is crucial for GANs training. The paper explores different positional encoding schema, including sinusoidal coordinate encoding and padding removal. We further discuss the relation and distinction between MS-PIE and InfinityGAN in these two modules.
Extensible coordinate encoding. The “expand” configuration of MS-PIE allows coordinate value extrapolation in the spatial dimension. However, its training sticks to a fixed coordinate matrix for each synthesis scale, and the framework aligns the real images to the fixed coordinate matrix with bilinear interpolation 1 during training. Such a design causes the synthesized content to attach to the coordinate matrix, thus inevitably creates repetitive content when the coordinate value periodically repeats as the matrix expanding. In Figure 14, we train a no-padding StyleGAN2 model with MSPIE-expand setting (i.e., config (k) in Table 5 of MS-PIE paper) on our Flickr-Landscape dataset. The model is trained at scales 256, 384 and 512, then test at scale 1408.
1The corresponding official implementation: https://github.com/open-mmlab/mmgeneration/blob/ 95f962e54815b8f72c015c134cd597e9eff3de36/mmgen/models/gans/mspie_stylegan2.py#L115.
Distinctions between no-padding and padding-free generator. The no-padding generator (NPG) in MS-PIE is conceptually related to our padding-free generator (PFG), but fundamentally different while considering how the information of border pixels in the feature space is processed. NPG gradually loses the information from border pixels after each convolution, since the border pixels are less visited than the other pixels (consider a 3×3 convolutional kernel, most pixels will be scanned for 9 times, while edge pixels will be only scanned for 4 times, and corner pixels only 1 time). Further note that the information loss worsens exponentially as the network stacking more convolutional layers. In contrast, our PFG pads feature values from the neighbor context before the no-padding convolution is applied. The information loss caused by the no-padding convolution is a natural way to discard the information that is spatially too far away from and less related to the current context.

heading: B CONCEPTUAL COMPARISONS AMONG DIFFERENT TASKS
text: C IMPLEMENTATION DETAILS OF COORDINATES
We first derive the receptive field size R of an L-layer GS after adding the 7×7 feature unfolding to all layers. Assume that the size of zS (i.e., output of GS, and input of GT) is M . The value of R can be derived asM +(2×3)×L, where 3 is the half-size of the feature unfolding area. In practice, with
an architecture shown in Figure 18 with training patch size 101×101, we have M = 11, L = 4, and R = 35.
Horizontal direction. In order to avoid the generator discovering and exploiting any property of the periodic coordinate, we use a period T much larger than R. Meanwhile, the period should be short enough to avoid the differences between consecutive coordinates vanish to almost zero. In practice, we use T = 4×R for both of the cosine and sine coordinates. Vertical direction. We utilize the property of the tanh function that its slope rapidly saturates to nearly zero and its value range is bounded by [−1, 1]. Such a property is aligned to the property of real-world scenery—the structural interactions among landscape objects are mostly concentrated around the horizon and rapidly saturates to a single modal (i.e., sky, ground, or water) in the vertical direction.
There are two hyperparameters while constructing the tanh coordinates: (i) a pair of cutoff points, and (ii) the sampling period of zl in the spatial dimension.
• Cutoff points (ccut) are a pair of values that, during training, we only sample the coordinates between the value pair. Such a hyperparameter is required since we are unable to sample all coordinates from an infinitely large coordinate system within the finite training steps. In practice, we set the cutoff points at ±0.995 of tanh-projected coordinate. Note that the underlying effect of using different cutoff point values is not well-investigated, we do not observe obvious changes with slightly different values. • Sampling period (dl) defines the distance between two spatially consecutive values of zl are sampled within a training sample. Such a value relates to the grain of the representation that the generator overall models. It is equivalent to the occupation ratio of zl between the cutoff points. Thus we can alternatively define a hyperparameter V that defines the occupation ratio of zl by RR+V . Then, the sampling period can be derived with dl = 2× ccut × 1R+V . In practice, we use V = 10, resulting in dl = 0.13̄.
C.1 MORE DISCUSSIONS ON THE CHOICE OF COORDINATE SYSTEM
In this paper, we mainly tackle the scenery image datasets, such as landscape, LSUN bridge and LSUN tower. The coordinate prior we introduced in Section 3.2 is specifically designed for such types of data, which has self-similarity in the horizontal direction and rapid mode-saturation in the vertical direction. However, we want to emphasize that the choice of coordinate system is a hyperparameter depending on the dataset. For instance, in Figure 16, we show that InfinityGAN can also work on satellite image dataset (Isola et al., 2017), which is more frequently used in texture synthesis task. A more natural choice of coordinate system in such a setting is using periodic coordinates in both horizontal and vertical directions. Nevertheless, in Figure 17 we observe that InfinityGAN can still produce visually plausible and globally sound appearances with using saturating (i.e., tanh) coordinates in the vertical direction and periodic coordinates in the horizontal direction.
In Table 4, we identify three categories of coordinate systems, but these options may not have covered all possibilities. One may need to be aware of the characteristics of the data and the intended outcome before selecting the appropriate coordinate system.
D INFINITYGAN ARCHITECTURE

heading: E MORE COMPARISON WITH BASELINES

heading: F MORE INFINITYGAN QUALITATIVE RESULTS
text: G INFINITYGAN RESULTS AT A HIGHER RESOLUTION

heading: H MORE RESULTS ON OTHER DATASETS

heading: I MORE DIVERSITY VISUALIZATION
text: J OUR BEST ATTEMPT IN INCLUDING AN EVERLASTING IMAGE
K IMPLEMENTATION DETAILS OF IMAGE OUTPAINTING AND INBETWEENING VIA INVERSION
Our pipeline is similar to that of InOut (Cheng et al., 2021). With a given image x, the objective of GAN-model inversion is to recover a set of generator-parameter-dependent input latent variables z∗ that can synthesize a resulting image x∗ that is similar to x. There exist multiple different implementations to recover z∗, we adopt the gradient-descent-based method, which optimizes z∗ as a set of learnable parameters with carefully designed objective functions. In the context of InfinityGAN, we optimize four groups of variables: zg, zl, style (zT) and zn. In particular, we uses theW+ space
formulation (Abdal et al., 2020; Wulff & Torralba, 2020) for zT, named z+T , where each layer in GT has its own set of zTi and each of the zTi is optimized separately.
Objective functions. We first introduce two image-distance losses to the inversion objectives:
Lpix = ‖x− x∗‖2 , Lpercept = LPIPS(x∗, x) ,
(7)
which LPIPS is the learned perceptual distance proposed by Zhang et al. (Zhang et al., 2018).
We utilize the Gaussianized latent space technique proposed by Wulff and Torralba (Wulff & Torralba, 2020), which uses a LeakyReLU of slope 5 to discount the last activation function (a LeakyReLU with a slope 0.2) in the StyleGAN2 mapping layer, and recovers Gaussian-like marginal distribution of z+T . With the Gaussian distribution prior, we can use the empirical mean µ + T and covariance matrix Σ+T (computed by sampling 10,000 z + T via zg) to recover an estimated z + T distribution. With the empirical statistics, (Wulff & Torralba, 2020) proposes to compute Mahalanobis distance: dM (z, µ,Σ) = (z − µ)T Σ−1 (z+T − µ). (8) Then, we construct a prior loss Lprior (Wulff & Torralba, 2020) that regularizes the zg, zl and z+T with Mahalanobis distance:
Lprior = λαdM (zg, 0, I) + λβdM (zl, 0, I) + λγdM (z+T , µ + T ,Σ + T ) , (9)
which λα, λβ and λγ are weight factors. For the cases of zg and zl with zero means and unit variances, the prior loss degenerates to an l2 loss.
Following StyleGAN2, we adopt a noise regularization loss Lnreg and noise renormalization. The full objective function of the inversion is:
Linv = λpixLpix + λperceptLpercept + Lprior + λnregLnreg , (10)
where λs are the weighting factor of each loss terms.
Hyperparameters. For all tasks and datasets, we set λpix = 10, λpercept = 10, λnreg = 1,000, λα = 10, λβ = 10, and λγ = 0.01. We use Adam (Kingma & Ba, 2015) optimizer with a learning annealing (Karras et al., 2020) from 0.1 to 0 for 1000 iterations. We use a batch size of 1 to avoid batch samples interfere with each other. Despite we observe batched inversion can sometimes yield superior results, it is not a conventional setting for real-world applications that batched inputs are mostly unavailable, it also significantly increases the stochasticity while reproducing the results.
Outpainting and inbetweening with inverted latent variables. With the inverted latent variables, we perform image outpainting by spatially extend the z∗l with its unit Gaussian prior, while using z ∗ g and z+T ∗
everywhere. For image inbetweening, z∗l is also extended with its unit Gaussian prior, while z∗g and z + T ∗ are fused with spatial style fusion. Notice that we do not optimize c in our pipeline, since inverting c is non-trivial and requires additional regularization losses. This introduces a limitation that the spatial position of the images is fixed after the inversion, the users have to perform the inversion optimization again if they want to assign z∗l to a different location.
Another limitation is that, despite the use of the prior loss, some dimensions of the inverted latents tend to drift far away from the normal distribution. In combination with the use of theW+ space of zT, the inverted latents are of high-instability, sometimes introduce checkerboard-like artifacts, and frequently mix multiple irrelevant contexts together. We develop an interactive tool (released along with the code release) that allows users interactively and regionally resampling the undesired local latent variables zl in the outpainting area. Such a limitation is highly related to the generalization of the inverted latents, we put it as an important future working direction.
L IMPLEMENTATION DETAILS OF SPATIAL STYLE FUSION
To achieve spatial style fusion in the existing InfinityGAN pipeline, we introduce two additional procedures: “style fusion map creation” and “fused modulation-demodulation”. The former creates per-layer style fusion maps that specify the geometry of the style fusion area. The latter one is a modified version of feature modulation-demodulation that processes the volumetric styles created from the style fusion map.
Style fusion map creation. Given N style centers designated by the user, in the pixel space, the target of style fusion map creation is to construct a set of style fusion maps for each layer of bothGS and GT. The fusion map is a spatially-shaped (i.e., batch×N×H×W ) tensor with N channels that specifies the weight of the style for each spatial location, which the weights sums up to one across the N dimension for each spatial position.
We first construct an initial fusion map in the pixel space by finding the spatially nearest style center, then assign a one-hot label for each spatial position in the initial fusion map. Since the spatial style fusion happens in all layers in the generator, we therefore reversely propagate the fusion map from the output of the generator to its input, we call such a procedure fusion map calibration. We show an illustration of fusion map calibration in Figure 32(b). The fusion map calibration starts from the image space and sequentially backward-constructs the fusion maps for all generator layers. For each pair (output-side and input-side) of the fusion maps in a network layer, we match the spatial dimension of the fusion map pair by padding or interpolating the output fusion map into a spatially aligned input fusion map. For different types of intermediate layers, the underlying implementation of the fusion map calibration can be slightly different, but a shared principle is to maintain a consistent geometrical position of the style fusion center throughout the generator.
In practice, such a binary map creates a sharp style transition that produces visible straight lines dividing the style regions. Accordingly, we apply a mean filter that smooths the style transition border. While different kernel sizes for the mean filter only alter the range of style transition and the visual smoothness, we use a kernel size of 127 in our experiments as it empirically produces good visual results.
Fused modulation-demodulation. After constructing the per-layer style fusion map, we can use the fusion maps to create volumetric styles (i.e., batch×D×H×W ) by weighted-sum the styles by the importance weights (D-channel dimension) in each spatial position. The volumetric styles are applied to each layer of the generator. As the feature modulation-demodulation strategy used in both StyleGAN2 and InfinityGAN is a pixel-wise operator, we can easily adapt it to volumetric styles. We demonstrate a possible implementation2 of the fused modulation-demodulation in Figure 33.
2The forward function is based on the implementation from https://github.com/rosinality/ stylegan2-pytorch.

heading: M MORE QUALITATIVE RESULTS OF OUTPAINTING VIA INVERSION

heading: N MORE QUALITATIVE RESULTS OF INBETWEENING VIA INVERSION

heading: O MORE QUALITATIVE RESULTS OF CYCLIC PANORAMIC INBETWEENING

heading: P EXPERIMENTAL DETAILS OF THE SPEED BENCHMARK WITH PARALLEL BATCHING
text: We perform all the experiments on a workstation with Intel Xeon CPU (E5-2650 2.20GHz) and 8 GTX 2080Ti GPUs. We implement our framework with Pytorch 1.6, and execute in an environment with Nvidia driver version 440.44, cuDNN version 4.6.5, and Cuda version 10.2.89.
We report the summation of pure GPU execution time and data scatter-collection time introduced by data parallelism. The model synthesizes a single image for each trial. We first warm up the GPUs with 10 proceeding trials without recording their statistics, then compute the mean and variance over 100 trials. The numbers are reported in Table 5.

heading: Q ABLATION: FEATURE UNFOLDING

heading: R LIMITATIONS
text: Here we discuss some empirical limitations of InfinityGAN.
Patch-training leads to performance degradation. In order to construct a better conditional distribution in the vertical direction with an auxiliary loss Lar, InfinityGAN trains the generator with patches instead of full images. However, training with patches reduces the training field-of-view, thus leading to an inferior performance at the same field-of-view compared to a model trained with full images. Designing unsupervised mechanisms in learning Lar without patch-cropping can improve InfinityGAN performance.
Long-range coherence. InfinityGAN assumes local coherence following a shared holistic appearance can achieve visually plausible synthesis. However, certain physical relationships still require long-range dependency, such as we can observe two suns in the top-left image in Figure 23, and twilight should only happen near the horizon in Figure 25. Despite InfinityGAN can independently sample pixels arbitrarily distant away, it remains unclear how to construct unsupervised losses for such conditions, as we only have finite-pixel images in training data.
Strip-shaped artifacts. We observe InfinityGAN creates a unique type of artifact that forms a strip-shaped structure sweeping through the sky or ground for a long distance, such as the clouds in the bottom-two image in Figure 23. We hypothesize the root cause of such an artifact is that the model attends too much to the strong structural characteristics of the horizon line and accidentally shares the representation with other less related contexts. We anticipate improving the modulation or coordinate encoding mechanisms may help suppress such behavior.
S IMPLEMENTATION ILLUSTRATION OF SCALEINV FID
1 import torch.nn.functional as F 2 3 def eval_scaleinv_fid(real_imgs, fake_imgs, scale): 4 # real_imgs: tensor of real images, shape (B, C, H, W). 5 # fake_imgs: tensor of fake images, shape (B, C, H, W). 6 # scale: the scale of the current ScaleInv FID. 7 fake_images = F.interpolate( 8 fake_images, 9 scale_factor=1/scale,
10 mode="bilinear", 11 align_corners=True) 12 13 # The regular FID evaluation 14 return eval_fid(real_images, fake_images)

heading: T MORE COMPARISONS WITH TEXTURE SYNTHESIS METHOD
text: As we discussed in Section 1 that texture synthesis models are not directly applicable to real-world image synthesis. In Figure 38, we demonstrate such a problem by running TileGAN (Frühstück et al., 2019) on our Flickr-Landscape dataset. The results show that the random texture synthesis cannot produce plausible global structures. It is important to note that the images are shown in TileGAN and other texture synthesis papers (Bergmann et al., 2017; Jetchev et al., 2018) with plausible global structure, such as the satellite map of Jurassic Park and the paintings in TileGAN, are all conditioned on an image that gives the blueprint of the global structure.
Implementation details of TileGAN experiment. We use the officially released TileGAN pipeline to synthesize the results with randomly sampled latent variables. We follow the instructions and train a PGGAN model at 256×256 resolution, then test the model to synthesize at 512×512, 1024×1024, and 2048×2048 pixels. Note that we discovered that TileGAN alters the PGGAN architecture from residual-based ToRGB branch 3 to single ToRGB projection 4. Such a modification is not described in the TileGAN paper, but can be found by diagnosing the model checkpoints released by the authors. The modification leads to significant visual-quality degradation. However, even without the visualquality degradation, the lack of structural clues makes TileGAN impossible to infer a coherent global structure while synthesizing at larger image sizes.

heading: U MORE COMPARISONS WITH SINGAN-BASED MODELS
text: We conduct additional experiments on ConSinGAN (Hinz et al., 2021), a concurrent work that proposes several improvements upon SinGAN. We use the officially released codes and hyperparameters to train the ConSinGAN models. ConSinGAN has two types of training modes, generation and retargeting. The author mentions the “retargeting” mode is more suitable for extending synthesis size in their GitHub release. As shown in Figure 39, similar to SinGAN, ConSinGAN does not have specialized mechanisms to deal with different positional information while tested at a different synthesis size. Therefore, neither of the training modes can produce a plausible global view while tested at extended synthesis sizes.
3Codes: https://github.com/afruehstueck/tileGAN/blob/0460e228b1109528a0fefc6569b970c2934a649d/networks.py#L274L294.
4Codes: https://github.com/afruehstueck/tileGAN/blob/0460e228b1109528a0fefc6569b970c2934a649d/networks.py#L370L375.
V ABLATION: MODE-SEEKING DIVERSITY LOSS (Ldiv)
W ABLATION: AUXILIARY LOSS (Lar)

Review summaries:
This paper proposes a novel framework, InfinityGAN, for infinitely-wide landscape image generation, combining recent advances on style-based generative adversarial networks and implicit neural representations. Leveraging parallelizable inference, patch-based generative modelling and hand-crafted landscape image priors, the proposed framework can synthesize landscape images of seemingly infinite width and a large height. The paper further proposes a new evaluation metric, ScaleInv FID, and a set of applications for their framework, including image outpainting and inbetweening, and spatial style fusion. The results of InfinityGAN are validated using user studies and some image-space metrics. 

This paper proposes a novel framework, InfinityGAN, which could generate arbitrary-sized images with infinite pixels.  By disentangling global appearance, local structures and textures, InfinityGAN generates local and global consistent large images with a seamless patch-by-patch paradigm.   Experiments validate its superiority compared to some other baselines, and several applications are raised based on their approaches.

This paper proposed a new model called InfinityGAN, for generating images of arbitrary sizes. These images are generated holistically: the authors proposed using a structure synthesizer first to generate a latent structural representation. Then a modified StyleGAN based texture synthesizer generates the image patches at the corresponding locations. The positional encoding and PFG enable generating patches in an arbitrary large image and aggregating these patches seamlessly. The experiments on the Flickr-Landscape dataset show promising large image synthesis performance. On the Place365 and Flickr-Scenery datasets, the experiment results show superior image outpainting performance. The authors also demonstrated other applications including spatial style fusion and image inbetweening.

The paper proposes a framework to generate high resolution images of outdoor scenes with any desired style. The approach extends image synthesis techniques and proposes a system that uses both global and local information. This ensures that the model can be trained using low resolution patches (e.g. 101 x 101) and, at inference time, it can be used to generate high resolution renderings: images up to 4096 x 4096 are showed.  The combination of the global and local appearance, coupled with interesting modules such as the padding-free generator, ensure high quality results that are consistently outperforming other approaches.