  A random field $X = (X_v)_{v \in G}$ on a quasi-transitive graph $G$ is a
factor of i.i.d. if it can be written as $X=\varphi(Y)$ for some i.i.d. process
$Y= (Y_v)_{v \in G}$ and equivariant map $\varphi$. Such a map, also called a
coding, is finitary if, for every vertex $v \in G$, there exists a finite (but
random) set $U \subset G$ such that $X_v$ is determined by $\{Y_u\}_{u \in U}$.
We construct a coding for the random-cluster model on $G$, and show that the
coding is finitary whenever the free and wired measures coincide. This
strengthens a result of H\"aggstr\"om--Jonasson--Lyons. We also prove that the
coding radius has exponential tails in the subcritical regime. As a corollary,
we obtain a similar coding for the subcritical Potts model.
  Our methods are probabilistic in nature, and at their heart lies the use of
coupling-from-the-past for the Glauber dynamics. These methods apply to any
monotone model satisfying mild technical (but natural) requirements. Beyond the
random-cluster and Potts models, we describe two further applications -- the
loop $O(n)$ model and long-range Ising models. In the case of $G =
\mathbb{Z}^d$, we also construct finitary, translation-equivariant codings
using a finite-valued i.i.d. process $Y$. To do this, we extend a mixing-time
result of Martinelli--Olivieri to infinite-range monotone models on
quasi-transitive graphs of sub-exponential growth.
