  We prove uniform upper bounds on the number of integral points of bounded
height on affine varieties. If $X$ is an irreducible affine variety of degree
$d\geq 4$ in $\mathbb{A}^n$ which is not the preimage of a curve under a linear
map $\mathbb{A}^n\to \mathbb{A}^{n-\dim X+1}$, then we prove that $X$ has at
most $O_{d,n,\varepsilon}(B^{\dim X - 1 + \varepsilon})$ integral points up to
height $B$. This is a strong analogue of dimension growth for projective
varieties, and improves upon a theorem due to Pila, and a theorem due to
Browning-Heath-Brown-Salberger.
  Our techniques follow the $p$-adic determinant method, in the spirit of
Heath-Brown, but with improvements due to Salberger, Walsh, and
Castryck-Cluckers-Dittmann-Nguyen. The main difficulty is to count integral
points on lines on an affine surface in $\mathbb{A}^3$, for which we develop
point-counting results for curves in $\mathbb{P}^1\times \mathbb{P}^1$.
  We also formulate and prove analogous results over global fields, following
work by Paredes-Sasyk.
