Solution
= Solution
In left-handed variables, both $\psi_L$ and $\widetilde\psi_R$ have $U(1)_X$ charge $-1$. Cancellation of the mixed $SU(2)_{\rm gauge}^2U(1)_X$ anomaly requires
$$
-2N_f I(\mathbf2)+qI(\mathrm{adj})=-2N_f+4q=0,
$$
where $I(\mathbf2)=1$ and $I(\mathrm{adj})=4$. Therefore
$$
\boxed{q=\frac{N_f}{2}}.
$$