Trading with Market Frictions, Optimal Portfolio Selection, and Diffusion Generative Models