The solution is obvious...governments need to make non-consensual reproduction of an individual's likeness illegal and actively enforce it.
This is a non-starter. If you're in public, people can take your picture. It's rude to do so without asking permission but it's still perfectly legal. If it were not legal, all those people recording ICE doing horrible things wouldn't be able to do so.
Even if there were an exception for recording people working for the public, you'd still end up recording bystanders in the background. It's too dangerous—from a societal perspective—to place roadblocks in the way of recording people or taking their picture. People do bad things every day and one of the only ways to deal with that is doing stuff like taking pictures without consent.
You could pass a law that bans this very specific use case: Distributing fake nudes but that's the thing: They're fake. They're just guesses (by a computer). From a legal perspective, it's no different than paying an artist to paint a nude painting of someone from a (non-nude) photo, which is not illegal.
Not only that, but you'd need a law like this to exist in every country, everywhere. Then you'd need some sort of enforcement mechanism. How would that even work?
"This person uploaded their likeness to the Internet, which was reproduced by Twitter 1 million times but then someone used it to make a fake nude of them which was reproduced by Twitter 10 million times. The Twitter TOS says that when you upload an image, they have no responsibility over it and retain the right to modify it in any way they see fit."
Do you go after the user, who might be in a completely different county? It might even be a bot, which would further complicate things.
I stand by what I said: There's no realistic way to prevent this other than to not upload pictures of yourself to the Internet.
We need people to understand that there's bad actors out there that will do things like make fake nudes of them and there's nothing that can be done to stop them. Once they have the image on their computer it's game over.
In regards to Xitter, specifically, STOP USING IT. If you haven't figured out that it's a total shithole by now it's time to wake up.