For something like img2img with Stable Diffusion, if the starting image is copyrighted by someone else I'd expect that the output image is a derivative work of the starting image.
The question is about new copyright in both cases, not subsisting copyright. You hold the copyright to the elements originating with you in a derivative work.