So he asked for suggestions from his leading man, Seth Rogen, who was in The 40-Year-Old Virgin and Knocked Up, two comedies written and directed by Judd Apatow, and one of the writers of Superbad, which Apatow produced. Rogen recommended Danny McBride, who appeared with him in Pineapple Express, another Apatow production.
Then Smith surveyed his Zack and Miri cast. Rogen's co-star is Elizabeth Banks, who was featured in The 40-Year-Old Virgin. Craig Robinson, who appeared in Knocked Up and Pineapple Express, also has a role. So does Jerry Bednob, another alumnus of The 40-Year-Old Virgin. Ultimately, Smith declined Rogen's suggestion.
As Smith recalls: "I had to actually stop him and go, 'Shouldn't you ask your boss or something? There's a lot of people from his movies.'"
Smith's predicament is just one part of a larger problem facing many comedy filmmakers in Hollywood: it is nearly impossible for them to make pot-smoking, breast-baring (but heartfelt!) movies without encroaching on the raunchy (yet tender!) turf already owned by Apatow.
That is the quandary facing Zack and Miri, directed by Smith, and Role Models, directed by David Wain, two upcoming comedies with very different pedigrees and different approaches to the question of how you avoid looking like imitations of Apatow's formidable achievements.
For Smith, it would be understandable if he held a grudge against Apatow; his directorial breakthrough, Clerks – a film so rude in places it was nearly rated NC-17 (unsuitable for anyone under 17) in the US solely because of its dialogue – predated The 40-Year-Old Virgin by 11 years.
And he has grown used to hearing that Zack and Miri, about two pitiful roommates who fall in love while making a pornographic movie, could have come straight from Apatow's slacker oeuvre.
Instead, Smith says he is grateful that Apatow has reinvigorated Hollywood's appetite for adult humour. "I thank God for Judd," he says, because he shattered what I assumed was a $30 million ceiling."
Smith says he had been kicking around the premise of Zack and Miri since at least 1997 but he was not sufficiently inspired to write the screenplay until he saw Rogen in The 40-Year-Old Virgin.
"The dude had come into his own, and he just sounded like one of my characters," Smith says. When the $148 million US box-office takings of Knocked Up made Rogen's stardom a foregone conclusion, getting the resources Smith needed for Zack and Miri – and casting Rogen – became easier.
"If I tried to make this movie ten years ago," Smith says, "I would have been making it for two million bucks, and maybe we'd get the standard release." Instead, the Weinstein Co opened the film, which cost $24m, in 2,800 cinemas across the US, backing it with a national print and television campaign.
For Smith, the challenge of working in a post-Apatow marketplace, and often the solution, is to come up with increasingly transgressive jokes.
"After 15 years, I've got a pretty good idea of what makes people – my people – squeamish," Smith says. "As time goes by, it gets harder and harder to find things that haven't been done a zillion times before."
Fellow comedy producers argue that while Apatow has a flair for over-the-top jokes, his collaborative film-making style is the true source of his success.
"He has an extraordinary ability to cast, and the luxury of spending the time with his actors, so that they are really able to work out the characters and the jokes," says Peter Safran, a producer whose films include Scary Movie and Meet the Spartans.
It is a lesson that Wain, the director of Role Models, has heeded. His film, about a pair of aimless adultescents ordered by the courts to work for a mentoring program, stars Paul Rudd, a supporting player in both Knocked Up and The 40-Year-Old Virgin. (Rudd, a longtime collaborator of Wain's, also helped write the script).
The cast has other actors associated with Apatow, including Banks, Joe Lo Truglio and Christopher Mintz-Plasse, who will forever be known as McLovin from Superbad.
Wain points out that many of these actors were his friends first. "With pretty much every part," he says, "it's like, 'Who do I want to work with? Who's fun to hang around with?' Those happen to be the people I've worked with over and over again, many of whom also work in Judd's films."
On Role Models, Wain says, he preferred to work with familiar actors because he made the movie from a mixture of scripted and improvised scenes – a strategy Apatow frequently employs. But Wain says this approach was the result of having more time and money (around $30m) to make the movie, and not Apatow's influence.
"If there's a great idea, but it involves switching gears on the shoot day, I can make that call," Wain says. "This is a funnier idea, so let's waste the film we already shot and start a new way."
Gross-out gags and improv comedy cannot quite cover up the fact that like many of Apatow's films are about male protagonists who are nominally grown up but must be dragged into adulthood.
This thematic overlap may stem from the similarly demoralising suburban childhoods that the creators of these films shared. "We're all generally not the most athletic kids, the most popular kids, not the best-looking kids," says Rudd – who, despite his chiseled good looks, says he can "understand the plight of the nerd".
It's also evidence that film-makers are not merely imitating Apatow but also influencing one another.
Comedies about stultified males are likely to remain popular, Rogen says, as long as young men continue to feel uncertainty. "It's so funny," he says, "when I look at these characters, they don't seem particularly underdeveloped in any way to me. They seem exactly like everyone I know."
The downside for actresses who appear in these comedies is that their roles are not likely to get bigger or more fleshed out. "The women are essentially having to play mother to their boyfriends," Banks says. In these guy-friendly films, she says, "they don't really write the women. They need to hire people to come in and improv, come up with something interesting to do."
But as long as Apatow's films are profitable, there will be incentives for studios to keep making movies like them. Wain says Role Models could be "the absolute bomb of the year, and it will still outgross everything I've ever done, combined."
Likewise, Smith says it is "very safe to say" that Zack and Miri will be his highest-grossing film to date. And if Zack and Miri should break that record because filmgoers mistakenly believe that Apatow collaborated on it, Smith says he can live with that.
"If somebody's seeing that trailer and going, 'Oh, it's from the same people that did Knocked Up and Superbad', I'm fine with that," he says. "I have no pretense of, 'No, it's from the guy who made Clerks!'
Zack and Miri Make a Porno is released on 14 November, and Role Models on 23 January
WHEN it comes to movie posters, be wary of the words "from the people who brought you…" The more vague the phrasing is, the less those "people" had anything to do with the film in question.
After Judd Apatow wrote, directed and produced the smash hits Knocked Up and The 40-Year-Old Virgin, marketing teams have been keen to associate as many other films as possible with the Apatow "brand". They've had an easy job, for the most part – he only produced Superbad, for example, but it was co-written by and starred Seth Rogen, star of Knocked Up. Apatow didn't write or direct Forgetting Sarah Marshall either – but its writer and star, Jason Segel, was in Knocked Up too, so there was a visible link. It's understandable, then, that a lot of people assume Kevin Smith's new film – starring Seth Rogen – was made by Apatow too. In fact he was not involved at all – but the assumption won't hurt the film.