A judge mostly sided with Midjourney, DeviantArt and Stability AI’s bid to dismiss the artists’ class action lawsuit that accused the firms of copyright infringement.