The algorithm, obviously.
I'm actually a bit surprised that this legal territory is so poorly explored, I would have assumed that at least there would have been challenges, lawsuits, and court cases on the validity (and ownership) of copyright for procedurally generated artwork long before now (of course, this would still leave as an open question the issue of whether such a work infringes on works an AI was trained on).