The plaque at the Met next to this Dürer reads:
One of Dürer’s most puzzling prints, Melencolia I is a depiction of the intellectual situation of the artist and, by extension, a spiritual self-portrait of Dürer himself. In medieval philosophy, each individual was thought to be dominated by one of the four humors; melancholy, associated with black gall, was the least desirable of the four, and melancholics were considered the most likely to succumb to insanity. Renaissance thought, however, also linked melancholy to creative genius, which made the self-conscious artist aware that his gift came with terrible risks.
TOE goes places so you don’t have to.