Earlier quoted context omitted.
Eh... I don't know. It sounds to me like you are saying because the code example outputs exact lines, it's a copyright violation; but the image AI's necessarily don't output exact copies of even portions of pre-existing images, that's not how they work. But I don't think copyright on visual images actually works like that, that it needs to be an exact copy to infringe. If I draw my own pictures of Mickey Mouse and Go…
I believe fair use is the way to go then. SD would definitely be so, in my opinion.
https://ogc.harvard.edu/pages/copyright-and-fair-use
This AI re-mixing stuff is so new, I think few legal observers would say they could definitely predict what the courts will do with it. Nobody really knew how the Google Books case, for instance, was going to go until it went.