8. Color the eight vertices of the cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with four different colors, requiring that the two endpoints of the same edge have different colors, there are $\qquad$ ways to color.
8. 2652 .

First, color the four points $A, B, C, D$ above, with 84 coloring methods. Then consider the four points below, using the principle of inclusion-exclusion, the total number of methods is
$$
\begin{array}{l}
84\left\{84-C_{4}^{1}[3 \times(3+2 \times 2)+\right. \\
(3+2 \times 2)]+2\left(\frac{36}{84} \times 9+\frac{48}{84} \times 4\right)- \\
\left.C_{4}^{3}\left(\frac{36}{84} \times 3+\frac{48}{84} \times 2\right)+C_{4}^{4}\right\} \\
=2652 .
\end{array}
$$