After winning us back with Midnight in Paris and earning his first Oscar in 25 years, Woody Allen assaulted audiences with one of the more tedious, inane, lifeless films of his entire career this summer: To Rome With Love. The workaholic director (who has been reliably churning out a feature virtually every year for over four decades) appeared as if he were exhausted — no, worse — sleepwalking with a camera in hand, muttering stale schtick he wrote in the 1970s. It’s sad to see your idols fail miserably. Thankfully, I’m happy to report that the spirit of Allen is alive and well in writer/director/unlikely leading man Mike Birbiglia’s Sleepwalk with Me. This charming gem set in the world of stand-up comedy, co-produced and co-scripted by This American Life’s Ira Glass, is the latest in a long line of smart bittersweet romantic tales heavily influenced by Allen’s 1977 classic Annie Hall, including When Harry Met Sally, High Fidelity, (500) Days of Summer and Blue Valentine. Like its predecessors, Sleepwalk works like a dream, winning us over without ever pandering to our expectations.

In this adaptation of his autobiographical one-man show, Birbiglia stars as a Matt Pandamiglio — a struggling comic with severe commitment issues and no real career prospects. Told largely in flashbacks with direct-address monologues interspersed throughout, Sleepwalk begins when Matt is about to move in with his girlfriend Abby (Lauren Ambrose) of eight years. Armed with five minutes of stale stand-up material, he’s determined to prolong his adolescence working as a bartender/janitor at a comedy club. Meanwhile, Abby is waiting for the schlub to grow up, drop the ring, and impregnate her — which terrifies Matt to no end and renders him limp in bed. “What if I’m holding the baby, and then the baby just dies,” he asks her.

In order to be a comic, Matt tells us, you have to be delusional. Fortunately, he suffers from a rare REM sleeping disorder that causes him to act out his dreams. While Abby tries to sleep, he fends off imaginary jackals in his bedroom, takes showers fully clothed, races through open fields and even engages in lengthy conversations with Stanford University professor and Sleep Research Center founder William C. Dement (played by himself). He’s hopelessly in denial about his condition until he falls through a second story glass window and finds himself in a hospital.

Meanwhile, Matt secures his own Danny Rose, Colleen (Sondra James), who sends him across the country for pathetic gigs that barely cover his gas. It’s on the road — away from Abby — where Matt finally gets comfortable and hilarious up on stage. For the first time, he stops focusing on bits and starts honestly connecting with his audience. He lets it all hang out, revealing his anxieties and romantic woes with strangers. “I’m not going to get married until I’m sure that nothing else good can happen to me,” he quips. Alas, his stand-up success inevitably eats away at his tired relationship.

Structurally, Sleepwalk with Me hits the traditional arc of most bittersweet romantic comedies. We love each other. We’re struggling to make it work. I can’t do this. It’s over. But Birbiglia has successfully told two loves stories simultaneously; the quest of a comic embracing his voice ends up being the more passionate (and intriguing) one, so it’s not surprising when he lets the boy-cheats-on-girl saga fizzle out. Along the way, Birbiglia steers clear of Hallmark sentimentality and reveals a deft ear for quirky details. Matt’s mother (the hilarious Carol Kane), for instance, is strangely passionate about ordering cakes off the internet. If there’s any justice, Sleepwalk should become the indie sleeper hit we’ve been waiting for all summer.

Read more about: