Quentin wakes up in a mental hospital, which looks exactly like Brakebills. Eliot and Alice are also a patients, Dean Fogg is a doctor, and Penny is an orderly. The same psychiatrist from the first episode tells him that the court ordered him to be there. She tells him that everything is a hallucination. Julia comes to visit him. She's at Yale and is getting married to James. He tries to perform magic for her by making fireworks, but no one can see it. Julia slips, saying that she couldn't see the fireworks.
Quentin notices that the hospital is called Ellsworth Downs. Jane Chatwin appears, telling him he's under a spell. She says that it's all him, and it's in the Fillory books, which his roommate tore up. Quentin gets the idea of singing Taylor Swift so that Penny in real life will come find him.
Quentin's father comes to visit. The psychiatrist tells Quentin that he tried to kill his father because he thought he was The Beast.
The real Penny enters Quentin's mind, and Quentin asks him for help, telling Penny to find Quentin in real life.
It's revealed that Julia and Marina were performing the spell on Quentin in order to mess with him.
Quentin tapes the Fillory pages together, and realizes that Ellsworth Downs is the Madness Maker, a magician who was cursed to only play game magic, and could drive other magicians insane.
Penny asks Eliot for help to look for Quentin. Kady arrives and shows them where Quentin is. They bring him to Dean Fogg, who says that the spell is a Scarlatti Web, and they need to summon a Matarese. In order to summon this spirit, all the protective barriers of Brakebills are lowered, which lets Marina and Julia to break into the school. Marina used to be a student at Brakebills before she was kicked out three months before graduation. She steals her magical memories back.
Penny goes back into Quentin's mind to guide him back, but it doesn't work. Kady confronts Julia, telling her that Quentin isn't waking up and Julia needs to reverse the spell. Julia goes to the Dean and confesses her part.
Quentin wakes up in a column of light, and sees Jane and Ellsworth Downs. Jane helps him remember the passage in the books about how to break the curse. The Madness Maker only played what he could win, which cut him off from the horror of life. Jane saw one way out for him, which was to stop playing and start living. Quentin wakes up.
Marina regains all of her magical memories from Brakebills, gaining new powers. She kicks Julia out of the Hedge Witches telling on her to the Dean.