Metasurfaces have shown flexibility in realizing various functionalities via shaping the geometry on the subwavelength scale. However, with increased design complexity, the flexibility makes the traditional paradigm based on expert knowledge less effective. Due to the ability to learn knowledge from raw data, deep-learning techniques have made remarkable progress in the automatic design of highperformance nanophotonic devices. However, deep-learning-based methods require a large amount of training data, which is very expensive for metasurface design. Therefore, there is still a need for efficient inverse design methods with lower data complexity and higher performance. In this Article, we modeled the inverse design problem as a probabilistic distribution learning problem and introduce normalizing flow as a flexible model to explicitly learn the distribution. To efficiently explore prior distributions without generating extra training data, we proposed a prior reshaping method that reweighs the original training data according to their fitness to the design target. The algorithm is implemented for designing niobium-based emitters in a GaSb thermophotovoltaic (TPV) cell, achieving an in-band emittance efficiency close to 99%. To further improve the data efficiency of inverse design, we explored the transfer learning ability of the proposed normalizing flow model. A new tungstenbased emitter for a GaInAsSb TPV cell was obtained with comparable performance using only 5% of data compared to the original design problem. The demonstrated approach is not only applicable to TPV device designs, but may also be used in various datadriven inverse design problems, such as artificially structured materials, synthetic materials, and mechanical devices.