For comedian Mike Birbiglia, far left, dreams get a little too real in his autobiographical directorial debut, “Sleepwalk With Me.”

You don’t want to share a bed with Mike Birbiglia. See “Sleepwalk With Me,” the film based on his life, and you’ll understand why.

Birbiglia, the stand-up comedian who wrote, directed and stars in the film, suffers from a sleep disorder that causes him to act out his dreams. And he doesn’t dream about peaceful things: One time, convinced that a guided missile was heading toward his room, Birbiglia threw himself out of a second-story window, nearly dying in the process. The film’s depictions of his nocturnal activities get so outlandish that Birbiglia chose to open the film by talking directly to the camera and assuring viewers that what they’re about to watch is a true story. And it is, mostly.

“The stuff you wouldn’t think is true, is true,” Birbiglia says. “All the strange waking up in the hotel hallway while sleepwalking — all that stuff actually happened. The minutia of it is convenient for story.”

The detours from reality gave Birbiglia creative space that a true-to-life film wouldn’t have.

“Woody Allen was like, ‘I’m gonna make 40 films and I don’t [always] want to make something that’s autobiographical,’ ” Birbiglia says. “That’s smart, because then you get ‘Bullets Over Broadway,’ and it’s a great film and I’m sure there are autobiographical elements to it, but there’s a murder.

“I want to allow for there to be murder in my future films,” Birbiglia says. “But I don’t want to have committed a murder.”

There’s no murder in “Sleepwalk with Me,” but there is a series of deaths. In one of the film’s best scenes, Birbiglia’s character talks with other standups about their worst onstage failures. “The Daily Show’s” Wyatt Cenac wins (or loses) with his story about a performance for day laborers outside a Home Depot that ended with Cenac shouting “Long live the immigration police!” in Spanish. (He meant to say “the immigrant worker.”)

“I think Wyatt’s [story] was incredible. It’s so utterly horrible, but also everyone’s laughing, and it’s their mutual failure and struggle that unites them.”

And the scene rings utterly true.