Warning: broad spoilers ahead for season 1 of Carnival Row.

H.P. Lovecraft is one of the most imaginative, singular, brilliant, and influential horror writers of all time. He’s also one of the most overtly, profoundly racist. Lovecraft’s fans and heirs have long struggled with the question of how to separate his particular vision of cosmic horror from the visceral loathing of non-white people he expressed in his work.

In the past, authors like August Derleth and Stephen King have mostly tried to ignore the prejudice, concentrating instead on Lovecraft’s vision of a grotesque universe bent on humanity’s destruction and the joys of his clotted, tentacular, Cyclopean prose. More recently, though, several writers have engaged Lovecraft’s racism more directly. These creators are turning Lovecraft inside out, exposing his wet, ugly innards for antiracist purposes. The new Amazon eight-episode fantasy series Carnival Row is one of the first indications that this strand of antiracist Lovecraft fiction is traveling out of genre fiction and into more mainstream entertainment.

Some apologists, like scholar S.T. Joshi, have argued that Lovecraft’s offensive views were only central to a few of his lesser works, like the bigoted poem with a title that starts “On the Creation Of” and ends with a racist slur. Those protests aren’t convincing, though. Racism permeates Lovecraft’s work. The vast, terrible cosmic horrors he wrote about are always connected to his fear that the pure, upstanding white race is being corrupted and overrun with foul emanations from the less eugenically pure. In Lovecraft’s classic 1926 story The Call of Cthulhu, for example, the Elder Gods from outside space and time are remembered and venerated by “Esquimau diabolists and mongrel Louisianans” — by non-white people, in other words.

By contrast, Lovecraft’s protagonist is Gustaf Johansen, a white Norwegian sailor. And when he and his shipmates encounter Cthulhu’s non-white human followers, they butcher them in a fury, which Lovecraft enthusiastically endorses. “There was some peculiarly abominable quality about [Cthulhu’s worshippers] which made their destruction seem almost a duty,” Lovecraft writes. In his view, the fanciful tale of mystic horror is also a call to genocide.

Most of the horror writers channeling Lovecraft’s style or subject matter haven’t larded their prose with slurs or calls to race war. But some contemporary writers are now going further by writing Lovecraftian horror that directly acknowledges and repudiates Lovecraft’s ugly bigotries.

Ruthanna Emrys’ remarkable The Litany of Earth, for example, is told from the perspective of one of Lovecraft’s fish-people from the story The Shadow over Innsmouth. For Lovecraft, the Innsmouth inhabitants were evil because they were associated with racial mixing, which tainted them and caused them to de-evolve. For Emrys, though, the shadow in Innsmouth is the evil white people bring with them when their government murders the town’s inhabitants for the sin of being different. The real horror in this story update isn’t fish-people; it’s violent prejudice, as seen from the monsters’ perspective.

Matt Ruff’s novel Lovecraft Country takes a different approach to antiracism. The book is set in the 1950s, and its lead characters are all black. Next to the constant threats of life inside an inherently biased, racist system, the various space creatures, curses, and ghosts that the protagonists encounter are almost a pleasant diversion. Lovecraft was imaginative and entertaining, the book suggests, but his racism and his whiteness meant he didn’t know much about fear. (Lovecraft Country is being turned into an HBO series helmed by Jordan Peele and J.J. Abrams.)

Novelist N.K. Jemisin is also planning a novel about a multiracial group of New Yorkers who fight Cthulhu. As she put it in a publisher’s interview: “This is deliberately a chance for me to kind of mess with the Lovecraft legacy. He was a notorious racist and horrible human being. So this is a chance for me to have the ‘chattering’ hordes — that’s what he called the horrifying brown people of New York that terrified him. This is a chance for me to basically have them kick the ass of his creation. So I’m looking forward to having some fun with that.”

Carnival Row is just the latest narrative to repurpose Lovecraft’s tropes into an antiracist story. Still, the way it uses Lovecraft’s legacy is innovative, not least because it’s so casual. The series is set in a steampunk alternate fantasy Earth. Pixies, fauns, centaurs, and other faerie creatures (or “critch”) live in the segregated neighborhood of Carnival Row in a London-like city. Humans generally hate the critch, and one man with a hammer has started to murder them indiscriminately. Police detective Rycroft Philostrate (Orlando Bloom) is determined to bring the killer to justice despite his department’s indifference to the killings.

Philo does catch the murderer, “Jack,” in the first episode. Cornered, the guy starts to spout ominous gibberish in the tried-and-true manner of many of Lovecraft’s half-mad, Elder-God-touched sailors and riffraff.

“Think I’m mad?” Jack rants. “I know darkness. I’ve been to the twilight edge of the world and dredged up things from the sunless deep that would turn your blood cold. But nothing like what I saw in the dark beneath our very feet. You’re ill-prepared for the darkness that lies ahead. There is more here than you can fathom. While you go about your life so sure that this little world belongs to you, some Dark God wakes!” That’s a nicely baroque variation on Lovecraft’s famous line, “In his house at R’lyeh, dead Cthulhu waits dreaming.”

Sure enough, Carnival Row meets the dark god: a slimy, shambling horror, with tentacles hanging from its face. It looks a good bit like Cthulhu fan art. But it resembles Lovecraftian beasties in other ways, too. The critch are marginalized people from a foreign land. In the series, they’re a metaphorical stand-in for immigrants, sex workers, and people of color — all the chattering hordes Lovecraft hated. “They come from a dark place and they haven’t come alone. They’ve brought something with them,” Jack warns. As in Lovecraft’s work, non-white people are a threatening, indistinguishable mass, embodied by the ugly cosmic horrors they bring to the sane, rational foundations painstakingly built by white men.

Carnival Row’s dark god is a creation of critch magic. But it wasn’t raised as a weapon against humans. It was brought to life by one of those humans. The Cthulhu-thing is sewn together from dead flesh, but it’s just a puppet. Someone has to magically pull its strings. It’s a mask some human wears, just as Cthulhu is a mask Lovecraft wore.

Carnival Row sets the audience up to think that marginalized people have birthed a monster, in standard Lovecraft fashion. But then it reveals that the actual monster is built by those in power, who create an ugly caricature of the race they hate, then use that caricature for murder. The clear suggestion is that Lovecraft’s real racism, rather than his fictional monsters, was the threat facing a civilized society.

Lovecraft isn’t Carnival Row’s primary focus. Unlike Emrys and Ruff, the show’s creators deal with and dismiss Cthulhu off to the side of the main romance and intrigue plots. Jane Austen, Charles Dickens, and the fantasy genre are all arguably more important influences on the series than Lovecraft.

But that makes the antiracist twist on his work feel even more significant. We seem to be reaching a tipping point in Lovecraft influence where even works not explicitly devoted to addressing his racism will still have to contend with his legacy and find ways to acknowledge and subvert it. Carnival Row is more evidence that the smartest, most successful uses of Lovecraftian tropes don’t avoid or ignore his racism. Instead, they confront it and use it to enrich the narrative and surprise the audience. They’re making something bigger and better from his work.