Nowadays the gradient calculation is disabled when calling the DiffusionPipeline object (example in here).
IMO, this makes the framework less flexible to work with some use cases. For example, this framework had to copy the whole __call__ method just to be able to get the gradients attached to the output image tensor.