Well, it may be legal to create such a painting, but (depending on details) it may be a derivative work, in which case the original work's copyright still applies.
In other words, in your example, the painter is not necessarily free to distribute their painting while ignoring the original image's copyright.
Of course, this is not about the works. This is about the painter, and it's mostly not about exact duplication of the work but about works based on their previous work. You know, like other painters do.
Ostensibly, they want to prevent OpenAI, and any algorithm from making works based on their work.
But, frankly, what they really want is not really that. What they really want is to prevent it from making any works at all.
The real problem is these algorithms making works of similar quality to the artists. Thousands for $20/month (in OpenAI's case)
Now there are egregious examples where this is abused to target a specific artist, and I'm sure you'll find all the AI companies are entirely on board with preventing that.
The NN has copyright material stored (maybe in compressed form) inside of it. That's quite literally the definition of copying, and if you do that without licence copyright infringement.
Note how software licences typically give you the licence to make a copy for running the program? That's because the act of copying the program from the medium (cd, USB stick, HDD...) is considered copying.
I really don't understand what's so difficult to grasp about this. And yes it is illegal to sell equipment whose purpose is circumventing copyright protections.
> The NN has copyright material stored (maybe in compressed form) inside of it.
There isn't anything like enough space in one of these models to store all the training material, "compressed" or otherwise. Not by orders of magnitude.
I don't know US, but if similar to Australia then you can sell the machines, but there are specific regulations regarding public access to them, which boils down to posting notices about copyright violations and passing liability onto the user. Because apparently a stern warning stops students from photocopying expensive text books. Which is the sort of thing Midjourney and OpenAI will be relying on for their defense, yes.
It is also interesting that there are technology specific laws. You can't sell photocopiers to the public capable of reproducing bank notes for example. Or taxes added to blank medium such as cassette tapes.
In other words, in your example, the painter is not necessarily free to distribute their painting while ignoring the original image's copyright.