“WILL & GRACE” star Sean Hayes is incredibly successful at portraying lovable gays — but he’s so good at it that the actor is terrified he’ll never have a chance to play a straight guy.

In a candid interview, talented Sean revealed he’s worried he’s typecast as a “funny gay guy.”

In his first major film, “Billy’s Hollywood Screen Kiss” in 1998, Sean played unlucky-in-love gay photographer Billy. And he was launched to fame by his portrayal of swishy and flamboyantly gay Jack on the hit NBC sitcom.

As part of his effort to avoid typecasting, Sean is the voice of “Mr. Tinkles” the cat in the new hit movie “Cats and Dogs.”

Originally, Sean was supposed to play the more subtly gay Will — but Eric McCormack beat him out for the part and producers ended up casting Sean as Jack.

Sean, who refuses to discuss his sexuality, is proud of “Will & Grace” and believes the ground-breaking sitcom will do for gays on TV what “The Jeffersons” did for African-Americans 20 years ago.

Yet his gay typecasting fears leave him frustrated. “I don’t want to play a gay guy for the rest of my life,” divulged Sean. “It’s not why I became an actor. I like to play other characters and in Hollywood, sometimes it’s hard for them to think outside the box.

“Once they see you in one thing, it’s like, ‘We need someone to play this gay guy — Oh, just call Sean Hayes, he’s a funny gay guy.’

“So I’m definitely looking forward to other things.”

But, added Sean, that doesn’t mean he’ll turn down roles just because they’re gay. “Oh no, not at all — if it’s the right part and the right script.”

Working is what matters, and Sean realizes that in showbiz, one minute you’re riding high and the next, you’re a nobody. In fact, the Emmy winner found that even though he stars in a hit show on network TV, he’s by no means a household name.

As a teenager, Sean Hayes was an extra in Winona Ryder’s first movie “Lucas” — filmed at Sean’s High School in Glen Ellyn, Ill.

Revealed Sean, “Some of the movie auditions I go on, they never heard of ‘Will & Grace.’ A year ago (when the show was already a big hit), I auditioned for this one movie and the director was looking at my resume and he said, ‘”Will & Grace,” is that a TV show?’

“And I said, ‘Yes,’ and he asks, ‘Is it still on?’ And I said, ‘Yeah, it’s still on.’ I mean, amazing!”

Sean disclosed how he backed into the role of Jack. “Originally I was supposed to read for Will,” he recalled. “I was at the Sundance Film Festival in Park City, Utah, and the producers sent me a script.

“At the time, I didn’t want to leave Utah and return to L.A. because, you know, I had my first film there and it was exciting. And I didn’t have money to fly home just for an audition.

“When I got back they said they had found a Will and asked if I would come in and read for Jack, and I said, ‘Yeah.'”

Sean’s glad he made his fateful decision to try out as Jack, because not only is “Will & Grace” highly rated, but he believes it will go down in TV history as a groundbreaking sitcom.

“It’s what ‘Good Times’ or ‘The Jeffersons’ were for the African-American community,” and, he believes, it will force people to look beyond stereotypes and see gays as people, first. And because of that, someday in the future, said Sean, “People will look at the show and say, ‘Can you believe how we used to treat gays?’ “