Implicit Diffusion: Efficient Optimization through Stochastic Sampling