Conditional Generation in Flow Matching and Diffusion Models