Diffusion models for the dynamics of flexible molecules