The multi-energy complementary power generation system, incorporating wind, solar, thermal, and storage energy sources, plays a crucial role in facilitating the coexistence and mutual reinforcement of conventional thermal power and renewable energy. Against the backdrop of evolving power systems and the increasing integration of wind, solar, thermal, and storage technologies, scientifically optimizing the configuration of multi-energy complementary power generation systems has become an essential prerequisite for their sustainable development. This study introduces a dual-layer optimization model for configuring multi-energy complementary power generation systems based on the particle swarm optimization algorithm. The outer layer optimization aims to maximize the net revenue from wind, solar, and storage power generation while the inner layer optimization focuses on minimizing carbon emissions from thermal power units. The proposed approach comprehensively considers both environmental benefits and economic gains of multi-energy complementary power generation systems. Simulation results demonstrate that this method effectively enhances annual net income while significantly reducing carbon emissions by 1.1058 million tons. It establishes a rational capacity configuration scheme that not only improves economic performance but also promotes efficient utilization of clean energy resources. Furthermore, it highlights the advantages of coordinated carbon electricity market trading over traditional modes.