The integrated operation of PV power plants and hydropower plants is regarded as an efficient and promising approach for large-scale PV power accommodation. This study mainly focuses on studying the optimal sizing of small and medium-sized hydro-PV systems, which are abundant in the northwest and southwest of China but are rarely considered by the existing researches. In this study, a scenario analysis technique, which includes typical scenario classification, the analysis of the inflow and PV power output under each scenario and scenario combination, is proposed to deal with the uncertainties of the inflow of the hydropower plant and the PV power output. On that basis, an optimization model is developed to determine the optimal size of a PV plant complementarily operating with a hydropower plant, where the hydro-PV hybrid system provides the baseload of local power grid and renewable energy curtailment is not allowed. A two-layer nested algorithm is then proposed to solve the model in a hierarchical structure. In the inner layer, an iterative trial calculation method for coupled dynamic programming is used to optimize the PV capacity for the given scenario. In the outer layer, the traversal search algorithm is employed to search for the optimal PV capacity in each scenario, and a confidence level accumulation method is proposed to determine the PV capacity for different confidence levels. The developed model and method are applied to the Naijili hydro-PV hybrid system which is located in Qinghai Province, China. Case studies demonstrate that the optimization of the PV capacity can significantly promote the consumption of renewable energy and effectively mitigate the adverse impact of PV output fluctuations on the power grids. The optimal PV capacities for different confidence levels are obtained, which can make it easy for planners to determine the installed capacity of the PV plant based on their own appetite for risk. Moreover, it is observed that, for small and medium-sized hydro-PV hybrid systems, the impact of capacity expansion of the hydropower plant on the solar energy consumption and the total power generation of the system is not significant.