Should be illegal to use someone else's photograph without permission for the purpose of creating erotic works.
There. Finished. Easy.
If you wanna scribble a charcoal drawing of your crush and upload it to AI to try to make something erotic: legal, not relevant to this law; that's your own art. Same as if you make a painting currently.
If you take someone images off their social media and send it to a sad person's AI to generate porn: illegal.
If they give you permission: legal.
It comes down to consent and what an average person would reasonably expect, and you can be sure that a reasonable person would not expect people to take their images and make Ai porn with it.