DiffusionSfM: Predicting Structure and Motion via Ray Origin and Endpoint Diffusion