The train loop is wrong no ? neither x0s and eps are used in the expression of xts so it loons like your training to predict random noise
The loss function encodes information about the noise and, because the network sees the noised up image exactly, this is equivalent to learning about the actual sample images. It's worth noting that you could design a loss function measuring the difference between the output and the real images. This contains equivalent information, but it turns out that the properties of gaussian noise make it much more conducive estimating the gradient.
But point being, the information on the true images is in the loop albeit only through the lense of some noise.
xts = alpha_bar[t].sqrt() * x0s + (1.-alpha_bar[t]).sqrt() * eps
Additionally, the code isn't consistent.
In the sampling code a time embedding is used, while in training it isn't.