7. The quadratic equation $(1-\mathrm{i}) x^{2}+(\lambda+\mathrm{i}) x+(1+\mathrm{i} \lambda)=0(\mathrm{i}$ is the imaginary unit, $\lambda \in \mathbf{R})$ has two imaginary roots if and only if the range of $\lambda$ is $\qquad$ .
$$
\begin{array}{l}
\text { If } x \in \mathbf{R} \Rightarrow x^{2}+\lambda x+1+\left(-x^{2}+x+\lambda\right) \mathrm{i}=0 \\
\Rightarrow\left\{\begin{array}{l}
x^{2}+\lambda x+1=0, \\
-x^{2}+x+\lambda=0
\end{array} \Rightarrow(\lambda+1)(x+1)=0 \Rightarrow \lambda=-1 \text { or } x=-1 .\right.
\end{array}
$$

When $\lambda=-1$, $x^{2}-x+1=0$ has no real roots, which is a contradiction; when $x=-1$, $\lambda=2$. Therefore, the range of $\lambda$ is $\{\lambda \mid \lambda \in \mathbf{R}$, and $\lambda \neq 2\}$.