In this paper, we study a class of $Z_d$-graded modules, which are constructed using Larssons functor from $sl_d$-modules $V$, for the Lie algebras of divergence zero vector fields on tori and quantum tori. We determine the irreducibility of these modules for finite-dimensional or infinite-dimensional $V$ using a unified method. In particular, these modules provide new irreducible weight modules with infinite-dimensional weight spaces for the corresponding algebras.