The challenges in multi-objective and multi-dimensional optimization design of airfoils, marked by prolonged optimization cycles and low accuracy, call for an efficient solution to expedite airfoil design. This study presents an innovative airfoil generative design model based on a conditional variational autoencoder (CVAE). Initially, to overcome the limitation of insufficient training data, the model leverages the variational autoencoder (VAE) to learn the spatial distribution of University of Illinois at Urbana-Champaign (UIUC) airfoils, enabling the generation of a diverse set of airfoils with similar distributions. Subsequently, two CVAE-based airfoil generation models, the airfoil freedom design model and the airfoil precision design model, are proposed, which can realize diverse airfoil design under different conditions, such as shape and aerodynamic conditions. Furthermore, two measurements of roughness and diversity are introduced to evaluate the quality of the generated airfoils. The impact of different conditions and network parameters on the model’s generation performance is thoroughly analyzed. Results indicate that our proposed model achieves a 65% lower error compared to physics-guided conditional Wasserstein generative adversarial networks (PG-cWGAN) when generating airfoils that satisfy a specific lift coefficient and a 99.99% lower error compared to airfoil pressure distributions generative adversarial networks (Airfoil-Cp-GAN) when generating airfoils that satisfy specific pressure distributions. This method introduces a more creative and accurate approach for aircraft designers in the realm of airfoil design. The code used for this paper is available at https://github.com/liujun39/airfoilvae.