manifold diffusion, code