8. The function $f(x)$ defined on the set $\left\{x \in \mathbf{Z}_{+} \mid 1 \leqslant x \leqslant 12\right\}$ satisfies
$$
|f(x+1)-f(x)|=1(x=1,2, \cdots, 11),
$$

and $f(1) 、 f(6) 、 f(12)$ form a geometric sequence. If $f(1)$ $=1$, then the number of different functions $f(x)$ that satisfy the conditions is $\qquad$
8. 155 .
$$
\text{Let } f(k+1)-f(k)=e_{k} \in\{-1,1\} \text{.}
$$

Suppose $e_{1}, e_{2}, \cdots, e_{5}$ have $s$ ones, and $e_{6}, e_{7}, \cdots, e_{11}$ have $t$ ones. Then $e_{1}, e_{2}, \cdots, e_{5}$ have $5-s$ negative ones, and $e_{6}, e_{7}, \cdots, e_{11}$ have $6-t$ negative ones.
$$
\begin{array}{l}
\text{Thus } f(6)=f(1)+e_{1}+e_{2}+\cdots+e_{5}=2 s-4, \\
f(12)=f(6)+e_{6}+e_{7}+\cdots+e_{11} \\
=2 t+f(6)-6=2 t+2 s-10 .
\end{array}
$$

Since $f(1), f(6), f(12)$ form a geometric sequence, we have
$$
\begin{array}{l}
(2 s-4)^{2}=2 t+2 s-10 \\
\Rightarrow t=2 s^{2}-9 s+13 .
\end{array}
$$

When $s=0$, $t=13$, which is not valid;
When $s=1$, $t=6$; When $s=3$, $t=4$;
When $s=4$, $t=9$, which is not valid;
When $s=5$, $t=18$, which is not valid.
Therefore, the number of functions is
$$
\mathrm{C}_{5}^{1} \mathrm{C}_{6}^{6}+\mathrm{C}_{5}^{3} \mathrm{C}_{6}^{4}=155
$$