This paper presents a unified multimodal pre-trained model called N\"UWA thatcan generate new or manipulate existing visual data (i.e., images and videos)for various visual synthesis tasks. To cover language, image, and video at thesame time for different scenarios, a 3D transformer encoder-decoder frameworkis designed, which can not only deal with videos as 3D data but also adapt totexts and images as 1D and 2D data, respectively. A 3D Nearby Attention (3DNA)mechanism is also proposed to consider the nature of the visual data and reducethe computational complexity. We evaluate N\"UWA on 8 downstream tasks.Compared to several strong baselines, N\"UWA achieves state-of-the-art resultson text-to-image generation, text-to-video generation, video prediction, etc.Furthermore, it also shows surprisingly good zero-shot capabilities ontext-guided image and video manipulation tasks. Project repo ishttps://github.com/microsoft/NUWA.