Just no, that's not how any of that works.
I guess that lie is convenient to legitimate the lawsuit.
The output of stable diffusion isn't possible without first examining millions of copyrighted images
Then the suit looks a little more solid, because (as you pointed out) it isn't possible for the stable diffusion owner to know which of those copyright images had clauses that prevents stable diffusion trading and similar usage.
The whole problem goes away once artists and photographers starting using a license that explicitly removes any use of the work as training data for any automated training.
A license which should be opt-in, not opt-out.
Of course, it’s opt-out because they know, fundamentally, that most artists would not want to opt-in.
I dunno if it matters that the opt-in has to be at the legislation level.
After all, once Creative Commons adds that clause to their most popular license, it's game over for training things like Stable Diffusion.
I'm thinking that maybe the most popular software licenses can be extended with a single clause like "usage as training data not allowed".
Of course, we cannot retroactively apply these licenses so the current model will still be able to generate images/code; they just won't be able to easily use any new ones without getting into trouble.