The problem is enforcing the ban. Would it be a crime to have access to the software, or would they need to catch the criminals with the images and video files? It would be trivial to host a site in a country without legal protections and make the software available from anywhere.
Open source image generators already exist and have been widely disseminated worldwide.
So all you'd end up doing is putting up a roadblock for legitimate uses. Anybody using it to cause harm will not be seriously impeded. They can just pick up the software from a Russian/Chinese/EU host or less official distribution methods.
It would be as effective as the US trying to outlaw the exporting of strong encryption standards in the 90s. That is to say, completely ineffective and actually harmful. Enemies of the US were still using strong encryption anyway.
I feel like a sensible realistic course of action with this is it needs to be in the act of sharing/distributing. It would be way to broad otherwise as the tools that generate this stuff have unlimited purposes. Obvious child situations should be dealt with in the act of production of but the enforcement mechanism needs to be on the sharing/distribution part. Unfortunately analogy is blame the person not the tool on this one.
Yeah, I feel like if you find this shit on someone's computer, whether they shared it or not, there should be some consequences. Court-mandated counseling at a minimum.