Researchers at MIT have gone all evil scientist on us just in time to freak you out for Halloween—they created a "Nightmare Machine" that uses artificial intelligence to make the scariest possible pictures.

According to their website, MIT, with help from Australia's Commonwealth Scientific and Industrial Research Organization (CSIRO), creates "Haunted Places" and "Haunted Faces" using "computer generated scary imagery powered by deep learning algorithms and evil spirits!" The website says that "creating a visceral emotion" like fear is a huge part of human creativity, which made them wonder about artificial intelligence: "Can machines learn to scare us?" Well, yes, it turns out.

For Haunted Places, researchers used algorithms to figure out what haunted or toxic cities look like. Then, researchers "apply the learnt style to famous landmarks and present you: AI-powered horror all over the world!" They use different styles, including "Ghost Town," "Inferno," "Slaughter House," "Toxic Cites," and "Fright Night."

The Haunted Faces are even scarier, and are created using another algorithm. To help the algorithm learn what's really scary, MIT would like people to vote on which pictures they find frightening

While they started with celebrities, the Nightmare Machine has also made terrifying images out of Mickey Mouse, the presidential candidates, and Kermit the Frog:

Even the South Park kids got the Nightmare Machine treatment:

While the pictures look like something you might be able to make in Photoshop, humans aren't actually involved in changing the pictures. "Although people wrote the algorithm and showed it images," NPR reported, "the system learned from what it saw and applied those principles to create copycat horror images all on its own."

The project was created by three researchers at the MIT Media Lab: Iyad Rahwan, Pinar Yanardag, and Manuel Cebrian.

MIT's Nightmare Machine team did not immediately return Complex's request for comment.

Noting that Elon Musk said developing artificial intelligence is "summoning the demon," Rahwan told FiveThirtyEight, "We wanted to playfully explore whether and how AI can indeed become a demon that can learn how to scare us, both by extracting features from scary images and subsequently refining it using crowd feedback." Yanardog pointed out that "nothing seems to frighten humanity more than runaway intelligent machines." He told FiveThirtyEight, "The rapid progress in the field of AI has people worried about everything from mass unemployment to the annihilation of the human race at the hand of evil robots."

In an email to the Boston Globe, Rahwan said the researchers wanted to figure out the barriers that prevent humans and machines from cooperating. "​Psychological perceptions of what makes humans tick and what make machines tick are important barriers for such cooperation to emerge," Rahwan said. He added, "This project tries to shed some light on that front — of course in a goofy, hackerish Halloween-manner."

Maybe we're closer to Black Mirror that we'd like to think.