Adam Devine’s tenure on the raunchy “Workaholics” almost cost him a part in the even raunchier “Mike and Dave Need Wedding Dates.”

The suits behind the hard-R rated comedy loved Devine’s outrageous antics. They needed someone who could do more than shtick.Mike-and-Dave-Need-Wedding-Dates-poster-

“That was the big hang up with them, the studio bosses choosing me. They were like, ‘the insane one
from ‘Workaholics?’” Devine says. “They were worried the few scenes where I have to be a little vulnerable I wouldn’t be able to do it.”

So the 32-year-old star showed them other parts of his resume, including his kinder, gentler work on ABC’s “Modern Family.”

That apparently helped seal the deal.

Now, on the heels of Devine’s turn in “The Intern” and his work in the “Pitch Perfect” series, he’s officially added “leading man” to his blossoming resume.

The comedy is loosely based on the real-life antics of the Stangle brothers, the notorious pair behind the memoir “Mike and Dave Need Wedding Dates: And a Thousand Cocktails.”

Devine plays Mike to Zac Efron’s Dave, brothers who put out an ad seeing respectable dates for their sister’s wedding. The ad goes viral, gets them face time on “The Wendy Williams Show,” and attracts the attention of two less than respectable pals (Aubrey Plaza, Anna Kendrick).

You’ll see as much zany comedy as expected, but at times Mike and Dave dial it down for moments of introspection.

“It was an acting challenge for me to have multiple layers,” says Devine, who also voices Pizza Steve on the Cartoon Network’s “Uncle Grandpa.” “Mike is a crazy guy, then he realizes how far he’s gone.”

Devine met the Stangle brothers during the film’s production. They appeared on set, and they didn’t disappoint.

Drinks flowed. So did the laughs. At one point a hot tub and a pack of Australian women entered the fray.

“They’re very likable guys, not the kind of guys who pick on people. They want everyone to have fun and everyone in on the party,” he says.

RELATED: Joy Koy’s Comic Inspirations ‘Couldn’t Exist Today’

In person, Devine is charming and open, but it’s easy to spot the churning comic mind dwelling within. “Mike and Dave” director Jake Szymanski (“7 Days in Hell”) took full advantage of that.

Being the co-creator of shows like “Workaholics” and “Adam Devine’s House Party” affords the actor “an undeserving amount of respect,” he cracks.

That meant Szymanski let him improv freely on the set. Only the boss often had better ideas.

adam-devine-mike-and-dave-Jake-Szymanski-

Zac Efron and Adam Devine collaborate with director Jake Szymanski on the ‘Mike and Dave’ set.

“He’s so legitimately funny … a lot of times I’d be improv-ing and think, ‘this is gold,’ and then he’d be like, ‘say this,’ and I’d say, ‘this is way better than I was doing!’” he recalls, his voice rising.

Devine may be “old” by today’s youth-obsessed standards – he calls himself an “OG Millennial.” He still understands what young viewers crave today. He, like them, grew up watching classic sitcoms.

“This is stale and old and boring, and why is there a fake audience laughing at all the jokes? That was weird to us,” he says. “We had to reinvent what we thought was funny, [with] a lot of self-referential stuff and callbacks to our childhood.”

FAST FACT: Adam Devine had to re-learn to walk as a teen following an accident involving a cement truck. His legs were broken in several places, requiring a total of 26 surgeries to fix.

As a Millennial, he also has his own take on the encroaching PC rules that restrict comedy.

“I don’t like mean spirited … mean for the sake of being mean, or belittling someone just because they have a disability,” he says. “If they have a disability and they’re an a**hole then you can make fun of them. That’s the comedy.”

It’s something he’s noticed in recent years about “classic” movies the previous generation watched.

“You watch ‘80s movies … wow … they’re just making fun of that guy because he’s slow. I don’t like that. I like when bullies are put in their place,” he says.

After “Mike and Dave,” Devine is set to shoot the seventh, and final, season of “Workaholics.”

“You gotta know when to wrap it up,” he says. “We’ve done everything we wanted to do.”

Despite Devine’s busy schedule, he still hits the stand-up stage to try out new material. He used to do that as many as six times a week, but his current workload just won’t allow it.

He’s a Midwestern boy at heart, and he picked up his work ethic from his parents.

“My dad is a conductor of the railroad. He worked all the time, constantly, and he never complained. This is just what you do – go to work to afford a house and have a car to drive around,” he says. “That really resonated with me.”