Two teenage boys who used artificial intelligence to create fake nude photos of their classmates have been granted probation.