Play video content Breaking News SiriusXM

Louis C.K. whipped out his junk in front of Sarah Silverman, and masturbated in front of her -- but she was totally cool with it ... most of the time.

Yeah, we just said that. Sarah made the pretty startling reveal Monday on the 'Howard Stern Show' ... telling Howard about her early days in comedy with Louis. She says he asked if he could masturbate, and she told him, "F**k yeah, I want to see that!"

Sarah said there were times she told him no, and he would comply. She added they'd also go streaking together while "letting our freak flags fly."

She made a very important distinction, though, between herself and the women who accused him of sexual misconduct. Sarah says she and Louis were peers, on the same level as they were getting their starts -- unlike his accusers, over whom he had power in the biz.

Play video content 10/4/18 TMZ.com

We got Louis a couple weeks ago in NYC, and he's definitely in better spirits these days.