Here is a direct argument for $X$ satisfies the following condition: (*) there is a covering of $X$ by finitely many open affines $(U_i)$ such that each intersection $U_i\cap U_j$ is quasi-compact. (*)holds if the underlying space of $X$ is noetherian or $X$ is quasi-compact and quasi-separated.

Let $A:=\Gamma(X,O_X)$. Then we have a map of schemes $f:X\to {\rm Spec(A)}$. Now since $X_{red}$ is affine, we have a collection of elements $(f_i)\subseteq A$ such that each $X_{f_i}$ (the set of points of $X$ in which $f_i$ is invertible) is affine and $(f_i)$ generate the unit ideal.

The reason that I can choose such $f_i$ is that I can cover $X$ by open affines and I can cover these affines by the basis in $X_{red}$ (note that topologically $|X_{red}|=|X|$).

We have $X_{f_i}\to {\rm Spec(A_{f_i})}$ is an isomorphism for each $i$ because one can check easily under the assumption (*) that for any $a\in\Gamma(X,O_X)$ we have the canonical map $\Gamma(X,O_X)_a\to\Gamma(X_a,O_{X_a})$ is an isomorphism. Since $f^{-1}({\rm Spec(A_{f_i})})=X_{f_i}$ we know $f$ is an isomorphism.

[edit]As brunoh has pointed out in the comment, the above proof is not complete. I need to show $A_{red} \to \Gamma(X_{red},O_{X_{red}})$ is surjective. The following clever proof is taken from EGA 1, 5.19.1, I find it nice and want to share it with others.

Assumption: the ideal sheaf $\mathcal{I}$ of $X'\hookrightarrow X$ satisfies $\mathcal{I}^n=0$ for some $n>0$. $X'$ affine.

Factorize $\Gamma(X,O_X)\to \Gamma(X,O_X/\mathcal{I})$ as $\Gamma(X,O_X)=\Gamma(X,O_X/\mathcal{I}^n)\to \Gamma(X,O_X/\mathcal{I}^{n-1})\to\cdots\to \Gamma(X,O_X/\mathcal{I})$, we may assume $n=2$ (here we also need my above argument with $X'$ replace $X_{red}$). But then $\mathcal{I}=\mathcal{I}/\mathcal{I}^2$ is a quasi-coherent $O_{X'}$-module. Thus $H^1(X,\mathcal{I})=H^1(X',\mathcal{I})=0$. This shows the surjectivity.