Accurate photovoltaic (PV) power prediction plays a crucial role in promoting energy structure transformation and reducing greenhouse gas emissions. This study aims to improve the accuracy of PV power generation prediction. Extreme learning machine (ELM) was used as the core model, and enhanced and improved beluga whale optimization (EIBWO) was proposed to optimize the internal parameters of ELM, thereby improving its prediction accuracy for PV power generation. Firstly, this study introduced the chaotic mapping strategy, sine dynamic adaptive factor, and disturbance strategy to beluga whale optimization, and EIBWO was proposed with high convergence accuracy and strong optimization ability. It was verified through standard testing functions that EIBWO performed better than comparative algorithms. Secondly, EIBWO was used to optimize the internal parameters of ELM and establish a PV power prediction model based on enhanced and improved beluga whale optimization algorithm–optimization extreme learning machine (EIBWO-ELM). Finally, the measured data of the PV output were used for verification, and the results show that the PV power prediction results of EIBWO-ELM were more accurate regardless of whether it was cloudy or sunny. The R2 of EIBWO-ELM exceeded 0.99, highlighting its efficient ability to adapt to PV power generation. The prediction accuracy of EIBWO-ELM is better than that of comparative models. Compared with existing models, EIBWO-ELM significantly improves the predictive reliability and economic benefits of PV power generation. This study not only provides a technological foundation for the optimization of intelligent energy systems but also contributes to the sustainable development of clean energy.