Former “Silicon Valley” star T.J. Miller — who prides himself on performing marathon nights of comedy sets — even did a spontaneous private show, we hear, at the Stand for a customer’s birthday this week.

Comedy vet Jeffrey Gurian recalled to us that he’d done two sets at the Stand on Thursday when he was hanging with Miller “after he’d finished his seventh set of the night.”

When a patron approached Miller to say he was having a big birthday bash in a private room and wondered whether the comic would pose for a pic, Miller asked Gurian: “Do you think I should go for eight?”

Miller then quickly interviewed guests of the birthday boy, and “T.J. — who is a master at improv — took that material and went up and did a completely improvised set about the guy and blew everyone away,” Gurian marveled. “Especially the birthday boy himself could not believe that T.J. Miller was performing at his party.”

Miller has said, “When I work, I do . . . two to five sets . . . When I’m really working and do a full night, I can do between six and 10 12- to 15-minute sets.” But Gurian said that eight sets in one night broke Miller’s previous personal record.