8. Given a sequence $\left\{a_{n}\right\}$ with nine terms, where $a_{1}=a_{9}=1$, and for each $i \in\{1,2, \cdots, 8\}$, we have $\frac{a_{i+1}}{a_{i}} \in \left\{2,1,-\frac{1}{2}\right\}$. Then the number of such sequences is
8.491.

Let $b_{i}=\frac{a_{i+1}}{a_{i}}(1 \leqslant i \leqslant 8)$. Then for each sequence $\left\{a_{n}\right\}$ that meets the conditions, it satisfies
$$
\prod_{i=1}^{8} b_{i}=\prod_{i=1}^{8} \frac{a_{i+1}}{a_{i}}=\frac{a_{9}}{a_{1}}=1,
$$

and $b_{i} \in\left\{2,1,-\frac{1}{2}\right\}(1 \leqslant i \leqslant 8)$.
Conversely, a sequence $\left\{b_{n}\right\}$ of eight terms that meets the above conditions can uniquely determine a sequence $\left\{a_{n}\right\}$ of nine terms that meets the problem's conditions.

Let the number of sequences $\left\{b_{n}\right\}$ that meet the conditions be $N$. Clearly, $b_{i}(1 \leqslant i \leqslant 8)$ contains $2 k$ terms of $-\frac{1}{2}$; thus, there are $2 k$ terms of $2$ and $8-4 k$ terms of $1$. When $k$ is given, the number of ways to choose $\left\{b_{n}\right\}$ is $\mathrm{C}_{8}^{2 k} \mathrm{C}_{8-2 k}^{2 k}$. It is evident that the possible values of $k$ are only $0, 1, 2$, hence
$$
\begin{array}{l}
N=1+\mathrm{C}_{8}^{2} \mathrm{C}_{6}^{2}+\mathrm{C}_{8}^{4} \mathrm{C}_{4}^{4} \\
=1+28 \times 15+70 \times 1=491 .
\end{array}
$$

Therefore, by the principle of correspondence, the number of sequences $\left\{a_{n}\right\}$ that meet the conditions is 491.