Papers › StyleSwin: Transformer-based GAN for High-resolution Image Generation

StyleSwin: Transformer-based GAN for High-resolution Image Generation

20 Dec 2021CVPR 2022 1arXiv:2112.10762archive 2025-07-28

BoWen Zhang, Shuyang Gu, Bo Zhang, Jianmin Bao, Dong Chen, Fang Wen, Yong Wang, Baining Guo

Despite the tantalizing success in a broad of vision tasks, transformers have not yet demonstrated on-par ability as ConvNets in high-resolution image generative modeling. In this paper, we seek to explore using pure transformers to build a generative adversarial network for high-resolution image synthesis. To this end, we believe that local attention is crucial to strike the balance between computational efficiency and modeling capacity. Hence, the proposed generator adopts Swin transformer in a style-based architecture. To achieve a larger receptive field, we propose double attention which simultaneously leverages the context of the local and the shifted windows, leading to improved generation quality. Moreover, we show that offering the knowledge of the absolute position that has been lost in window-based transformers greatly benefits the generation quality. The proposed StyleSwin is scalable to high resolutions, with both the coarse geometry and fine structures benefit from the strong expressivity of transformers. However, blocking artifacts occur during high-resolution synthesis because performing the local attention in a block-wise manner may break the spatial coherency. To solve this, we empirically investigate various solutions, among which we find that employing a wavelet discriminator to examine the spectral discrepancy effectively suppresses the artifacts. Extensive experiments show the superiority over prior transformer-based GANs, especially on high resolutions, e.g., 1024x1024. The StyleSwin, without complex training strategies, excels over StyleGAN on CelebA-HQ 1024, and achieves on-par performance on FFHQ-1024, proving the promise of using transformers for high-resolution image generation. The code and models will be available at https://github.com/microsoft/StyleSwin.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2112.10762")

Code

Syntology Ran 5 of 5 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 4 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: official repository: 2 samples from 1 repository, 2 ran; 3 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

microsoft/StyleSwin officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

5 samples harvested; 5 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · our draft was wrong
1ran · fixture could not drive it

Licence: 3 of the 5 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from microsoft/StyleSwin. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

d_logistic_loss microsoft/StyleSwin/train_styleswin.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · f50887cc6f5e3a39 · report
d_r1_loss microsoft/StyleSwin/train_styleswin.py official repository ran · our draft was wrong MIT (permissive) · ea988988102f1c1d · report
window_partition identical code first harvested elsewhere ran · fixture could not drive it fingerprinted licence of this copy not recorded · 144d10b49baeb8a6 · report
data_sampler identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · dbb756dcd778f52f · report
window_reverse identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 61bf152e6a42a184 · report

Tasks

BlockingComputational EfficiencyImage GenerationVocal Bursts Intensity Prediction

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Generation CelebA 256x256 StyleSwin FID 3.25 #11 of 17 Archive leaderboard report
Image Generation CelebA-HQ 1024x1024 StyleSwin FID 4.43 #1 of 10 Archive leaderboard report
Image Generation CelebA-HQ 256x256 StyleSwin FID 3.25 #2 of 19 Archive leaderboard report
Image Generation FFHQ StyleSwin FID 5.07 #5 of 12 Archive leaderboard report
Image Generation FFHQ 1024 x 1024 StyleSwin FID 5.07 #14 of 20 Archive leaderboard report
Image Generation FFHQ 256 x 256 StyleSwin FID 2.81 #10 of 51 Archive leaderboard report
Image Generation FFHQ 256 x 256 StyleSwin (DINOv2) FD 300.18 #44 of 51 Archive leaderboard report
Image Generation FFHQ 256 x 256 StyleSwin (DINOv2) Precision 0.79 #44 of 51 Archive leaderboard report
Image Generation FFHQ 256 x 256 StyleSwin (DINOv2) Recall 0.28 #44 of 51 Archive leaderboard report
Image Generation LSUN Churches 256 x 256 StyleSwin FID 2.95 #6 of 27 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Adaptive Instance NormalizationAttentionDense ConnectionsFeedforward NetworkLayer NormalizationLinear LayerMulti-Head AttentionR1 RegularizationSoftmaxStyleSwinSwin Transformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections