I don’t know how it is implemented for the software in question.
Here's an interesting answer apropos to all this: https://opensource.stackexchange.com/questions/7250/could-i-...
I don't think it is necessarily enough to have simply started with a copyrighted work.
Imagine if Stable Diffusion was made illegal. Someone accuses me of using this illegal tool for an image that doesn’t look like anyone else’s image as far as the court is concerned for copyright. I put the image on my website. If the image itself is not at all infringing, then what is the evidence that Stable Diffusion was used? Should the police be issued a warrant to search my private property for proof that I used Stable Diffusion without a shred of evidence?
There is no such thing as “clean room painting” and it should be really obvious why that is…