  In 1970 Lov{\'a}sz gave a necessary and sufficient condition for the
existence of a factor $F$ in a graph $G$ such that for each vertex $v$,
$g(v)\le d_F(v)\le f(v)$, where $g$ and $f$ are two integer-valued functions on
$V(G)$ with $g\le f$. In this paper, we give a sufficient edge-connectivity
condition for the existence of an $m$-tree-connected factor $H$ in a bipartite
graph $G$ with bipartition $(X,Y)$ such that its complement is
$m_0$-tree-connected and for each vertex $v$, $d_H(v)\in \{g(v),f(v)\}$,
provided that for each vertex $v$, $g(v)+m_0\le \frac{1}{2}d_G(v)\le f(v)-m$
and $|f(v)-g(v)|\le k$, and there is $h(v)\in \{g(v),f(v)\}$ in which
$\sum_{v\in X}h(v)=\sum_{v\in Y}h(v)$. Moreover, we generalize this result to
general graphs. As an application, we give sufficient conditions for the
existence of tree-connected $\{g,f\}$-factors in edge-connected graphs and
tough graphs.
