Accurate photovoltaic power prediction is of great significance to the stable operation of the electric power system with renewable energy as the main body. In view of the different influence mechanisms of meteorological factors on photovoltaic power generation in different irradiation intervals and that the data-driven algorithm has the problem of regression to the mean, in this article, a prediction method based on irradiation interval distribution and Transformer-long short-term memory (IID-Transformer-LSTM) is proposed. Firstly, the irradiation interval distribution is calculated based on the boxplot. Secondly, the distributed data of each irradiation interval is input into the Transformer-LSTM model for training. The self-attention mechanism of the Transformer is applied in the coding layer to focus more important information, and LSTM is applied in the decoding layer to further capture the potential change relationship of photovoltaic power generation data. Finally, sunny data, cloudy data, and rainy data are selected as test sets for case analysis. Through experimental verification, the method proposed in this article has a certain improvement in prediction accuracy compared with the traditional methods under different weather conditions. In the case of local extrema and large local fluctuations, the prediction accuracy is clearly improved.