A nonuniform payoff allocation mechanism is proposed for spatial public goods games where individuals are nodes on a scale-free network. Each individual is assigned a weight ki α, where ki is the degree of individual i and α is an adjustable parameter that controls the degree of diversity in individuals’ profits. During the evolution progress, the allocation of payoff on individual i is assumed to be proportional to its weight. Individuals synchronously update their strategies according to the stochastic rule with a fixed noise level. It is found that there exists an optimal value of α which yields the highest level of cooperation. Other pertinent quantities, including the payoff and the probability of finding a node playing as cooperator versus the degree, are also investigated computationally and analytically. Our results suggest that a suitable degree of diversity among individuals can promote the emergence of cooperation.