Addressing the pressing need for sustainable energy solutions, this paper proposes a novel hybrid energy system integrating wind, alkaline fuel cells and solar energies. This paper introduces a pioneering hybrid energy system designed to produce electricity and hydrogen fuel through the integration of wind, solar energies, and an alkaline fuel cell. The proposed approach, coined as IWGAN–AVOA technique, synergizes the improved Wasserstein generative adversarial network (IWGAN) and the African vultures optimization algorithm (AVOA). The primary aim is to delineate a distinctive energy cycle reliant on renewable sources, featuring a Stirling engine, electrolyzer, alkaline fuel cell, wind turbine, and solar photovoltaic system, with the objective of generating hydrogen fuel and energy. The AVOA enhances fuel cell capabilities, simulates optimal system component sizes, and rectifies erroneous configurations based on geographical specifics. By validating the efficacy of IWGAN, the study achieves optimal configurations for device capacities and enhances power flow efficiency. Comparative analyses reveals that the IWGAN–AVOA approach surpasses existing techniques, like particle swarm optimization (PSO), wild horse optimizer (WHO), and heap based optimizer (HBO), with a remarkable efficiency rate of 98%, outperforming current methods. The last figure illustrates the effectiveness comparison, showcasing efficiencies of 62%, 79%, and 85% for HBO, PSO, and WHO, respectively, against the superior 98% efficiency achieved by the IWGAN–AVOA approach, affirming its superiority in energy system optimization.