Artificial intelligence (AI) technology has started to be integrated into our daily lives and work. Traditional discriminative AI focuses on learning decision boundaries between different categories of data and has already been widely applied in environmental science and engineering, such as water quality prediction and pollution detection. (1) Recently, the new frontier is generative AI, which generates new data instances based on learned data distributions. For instance, we can use large language models (LLMs) like ChatGPT to write, translate, and code, or we can use text-to-image models like DALL-E to create artistic works without prior drawing skills. (2) As it rapidly progresses, generative AI is bringing new possibilities to scientific research for many fields. (3,4) In the face of global sustainability challenges such as climate change, access to clean water, and biodiversity loss, generative AI may offer innovative solutions to these interconnected and large-scale sustainability issues. (5) This Viewpoint will discuss the current and potential applications and existing obstacles of generative AI in environmental science and engineering (Figure 1), aiming to inspire research in environmental generative AI and advance the discipline.