  Let $a$ and $b$ be positive integers such that $a\leq b$ and $a\equiv b\pmod
2$. We say that $G$ has all $(a, b)$-parity factors if $G$ has an $h$-factor
for every function $h: V(G) \rightarrow \{a,a+2,\ldots,b-2,b\}$ with $b|V(G)|$
even and $h(v)\equiv b\pmod 2$ for all $v\in V(G)$. In this paper, we prove
that every graph $G$ with $n\geq 3(b+1)(a+b)$ vertices has all $(a,b)$-parity
factors if $\delta(G)\geq (b^2-b)/a$, and for any two nonadjacent vertices $u,v
\in V(G)$, $\max\{d_G(u),d_G(v)\}\geq \frac{bn}{a+b}$. Moreover, we show that
this result is best possible in some sense.
