I feel that for this kind of AI stuff, the company behind the model could probably argue that they're not liable for what the individual user generates. So that for example with CSAM, that as long as they make sure that the training data doesn't contain that stuff, they probably should be fine and not be liable and/or criminally prosecuted.
Of course, an actual lawyer could probably explain why this would be a bad idea, but at least I as a non-lawyer don't see where the problem lies (aside from the fact that the company wouldn't want their stuff to be used to create CSAM, which is fair).