In its second season, “The Deuce” (HBO), a saga of the nineteen-seventies Times Square sex trade, is ripening into a squalid fantasia, and it sizes up the hustles of art and life through the eyes of Candy (Maggie Gyllenhaal). Formerly an independent street prostitute, now a rising auteur of pornography, Candy is on a journey that sets the tone for the show’s various threads about striving for stardom and self-determination—each of its American dreams is keyed to her self-education and to her picaresque ascent. The emerging artist is a lens through which “The Deuce,” created by David Simon and George Pelecanos, focusses on creative drive and sexual agency.

Candy’s passion project in progress is an artful adult adaptation of “Little Red Riding Hood.” It will be a film bristling with “hunger, terror, risk,” she imagines. A rich text at any time, the tale “lends itself to a certain interpretative elasticity,” as the scholar Maria Tatar puts it, “with some critics reading the story as a parable of rape, others as a parable of man-hating, still others as a blueprint for female development.” Candy’s work toward an interpretation of it—her labor toward asserting a vision of female desire amid 1977’s landscape of male lust—reads with special pungency in 2018, when traditional heterosexual masculinity has begun to look like a ubiquitous and perpetual criminal conspiracy. She is moving in on terrain that was formerly a gangster’s paradise, and establishing, at the center of the show, an enchanted forest where her imagination can roam.

The first episode of Season 2, “Our Raison d’Etre,” takes its title from a line spoken by Harvey Wasserman (David Krumholtz), Candy’s mentor in the construction of skin flicks. Fondly mocking his airs and hers, Harvey reminds her that their purpose is to gratify male desire, after she assembles a sex scene inspired, as her cameraman notes, by the acid trip in “Easy Rider.” As its female performer crescendoes toward orgasm, the cutting speeds up and impressionistic metaphors fly onto the screen: a bare fist juicing an orange half, a big cat dashing with wild grace, a pot boiling over. “So now we’re making art?” Harvey scoffs. Candy thought that it would be interesting to edit the scene to evoke a woman’s orgasm. Harvey appreciates the effort; he’s film-scholarly enough that the posters in his office include one for Kurosawa’s “High and Low,” with its title doubling as a topography of this show’s browscape. But he is also a businessman concerned about granting subjectivity to a sex object, saying that the men in the seats “don’t want to be in a woman’s head, not really.”

She loses the imagery but keeps the ecstatic acceleration. The end of the episode juxtaposes her solitary screening of a new cut with a scene of Vincent (James Franco) coming home to Abby (Margarita Levieva) and going to bed with her. It feels like a gloss on the end of “Ulysses”: the vision of their sex—which stands out for its passion, on a show where most of it is transactional or performative—meshes with Candy’s view of her work. The moment winds down with Vincent’s postcoital cigarette, matched against Candy’s tobacco as she savors the achievement of a vision. If the plumes of smoke have a whiff of triteness, it’s dispelled by the show’s fable-like treatment of doubles, and in how it shapes its story to resonate against the imagination of this storyteller.

Halfway through the season, Candy is increasingly clear about the boundaries of her wonderland, and about its sovereignty. “That’s not my fantasy,” Candy says, when drawing a line about what sort of scenes she’ll no longer shoot. Her talent as a fantasist extends from her understanding of control, as when she coaches Darlene (Dominique Fishback) on how to approach a role as a landlady accepting her tenant’s body in lieu of the overdue rent. “You’re in charge,” Candy tells her. “Enjoy your power.” Control, in imaginative terms, is a matter of pace. At the end of “What Big Ideas,” the fourth episode of Season 2, Candy’s cameraman, reviewing footage of a jailhouse scene, observes that a tracking shot past cell bars is “a little slow, but I think it looks great.” Because she, easily and breezily, has taken up a relationship with the guy—whose generic-handsome quality serves as a unstated gender-switched reversal on the disposable lovers and procurable muses—she drops into his lap for a nuzzle. “I wanted it slow,” she says.

In her journey toward adapting “Little Red Riding Hood,” Candy is of course herself an imperilled heroine treading through the woods. When she visits a potential investor, and he conditions his support on her on-the-spot performance of oral sex, she silently weighs the offer, staring into the middle distance, and decides to submit to his wolfishness, and she discloses no regret at the exploitation. Is she, in this meta-version of the fairy tale, the hunter as well as the innocent?

The most vital rendering of Candy’s inner life is a moment of repose—a tranquil reflection amid the perpetual motion of the show at large, with its pimps rolling down the sidewalk and dirty cops hitting the beat and Franco, playing twins, chasing himself around until all hours. Preparing to direct herself, Candy reclines on a desk, in a lilac bodysuit, beneath a wall clock. Is it about a quarter to one in the afternoon? The morning? Is the clock synced to the city’s sleeplessness? Or is it just a prop stopped at some idealized Pornotopia Standard Time? The moment is perfectly still. Having hurried up, Candy waits, while technicians slide past, like the ideas she thinks out loud for scenes she dreams to shoot: a musical number, a dance sequence, a vérité liquor-store robbery. She asks herself, and everyone, “Who would have thought the most boring part of this whole thing is the fucking?”