With "Manhattan," a sparkling romance about the overspecialized anxieties of overintellectualized New Yorkers, Woody Allen has bounced back from the sobriety of "Interiors" to an exhilarating new comic high.

Consistently amusing and discreetly affecting, "Manhattan" achieves a tangier blend of social commentary, wit and romantic pathos that did "Annie Hall," which collected its awards a little prematurely.

If Woody Allen needed a breakthrough into sustained realistic humor, this is it.

While Allen concentrates on a handful of characters in a rarefied, parochial social group and occasionally exaggerates their behavior for effect, the humor grows out of realistically depicted episodes.

There is no stepping out of character, no deviation into flashback or outrageous farce.

Allen and co-writer Marshall Brickman have invented some situations that look dubious on the face of it. It's difficult to be persuaded that Allen, as a twice-divorced TV comedy writer named Isaac Davis struggling with a first novel, could be involved in a torrid affair with a sweet, precocious 17-year-old played by Mariel Hemingway. But Allen does his most convincing paternal action in the scenes with Hemingway's Tracy.

Their liaison is played out with admirable sincerity and culiminates in two wonderful parting scenes, unexpectedly beautiful bittersweet confrontations that establish Allen's new command of sentimental material. The second encounter, which also closes the film, is especially impressive.

Isasc's misbegotten second marriage, to a humorless lesbian played by Meryl Streep, places another sort of strain on credulity. Allen and Brickman finesse this dubious idea by exploiting it as an irresistibly absurd pretext for humor. Isaac's ex may not have a funny bone in her body, but she beats him to the literary punch with a confessional best-seller.

Brooding about his kid, Isaac declines to accept the consolation of an acquaintance who's just read an article about how boys raised in lesbian households aren't necessarily fouled up. "I always felt it was unusual to survive one mother," he says.

If Allen always looks fundamentally mismatched with Streep and Hemingway, he and Diane Keaton seem more adroitly matched than ever before. In "Manhattan" they recover the prickly, combative romantic comedy rapport that seemed to slacken off in "Annie Hall," perhaps because those characters were modeled too complacently on themselves.

An adorably romanticized naif in the title role of "Annie Hall," Keaton is brilliantly funny in "Manhattan" as an abrasive, fiercely pretentious literary journalist named Mary Wilke. Mary drifts into an affair with Isaac after he's tried to end things with Tracy and she's trying to end things with Isaac's best friend, a married professor played by Michael Murphy.

Allen and Keaton met cute in "Anne Hall." They meet hostile in "Manhattan," when Mary looks down her nose at every exhibit Isaac recommends at an art gallery. The funniest scenes in the movie capitalize on the extraordinary comedy teamwork that has evolved between Allen and Keaton.

In "Manhattan" it's the setting that's romanticized, rather than the character played by Keaton. Allen begins the movie with a mock-heroic evocation of the city, underscored by Gershwin's "Rhapsody in Blue," in which Isaac confesses to a desire to romanticize the city "out of all proportion" while simultaneously perceiving it as "a metaphor for the decay of contemporary culture." Gershwin songs are used to enhance several episodes.

Even the black-and-white photography is intended as a romantic flourish. Unfortunately, I don't think cinematographer Gordon Willis has given the movie a black-and-white visual sheen that harmonizes completely with the bouyancy and wit of the script. I wish the film had the pearly black-and-white contrasts that used to typify the most sophisticated comedies from Paramount. "Manhattan" never looks as chipper as it sounds and plays.

Allen still finds it difficult to meet certain dramatic challenges head-on. He more or less acknowledges the problem when he gives Isaac the line, "I can't express anger," during the scene in which he and Mary call it quits. Although a break-up seems inevitable, Allen Doesn't quite dramatize it. He tends to give us updates after the characters make up their minds in private instead of using confrontations as decision-making events.

The key scenes with Hemingway demonstrate a talent for transcending this inhibition. In addition, Allen expresses several kinds of personal and social interplay more subtly and astutely than he's ever done. There's a splendid quick exchange between Isaac and Mary when they meet accidentally for the second time at a Museum of Modern Art fund-raiser. "What are you doing here?" he asks politely. "of course I'm here," she replies, obviously stung at the unintentional implication that someone of her cultural standing wouldn't be at the day's big cultural get-together.

In their earlier collaborations Keaton often got funny lines that seemed to belong to Allen Himself. In "Annie Hall" she endeared herself by barely being able to articulate a coherent sentence. In "Manhattan" she finally gets distinctively funny lines. They seem to belong to no one else except the imaginary character called Mary Wilke. Perhaps the best is her coy deflection of Murphy's advances while they're standing at a cosmetics counter in Bloomingdales: "Stop it. We're in the middle of Bloomingdale's and someone's going to see us."

Ironically, Keaton's character has acquired many of the disdainful, snobbish tendencies that made Allen's Alvy Singer seem like a terminal New York chauvinist in "Annie Hall." At last acknowledging the pathetic absurdity of that nobbery, Allen now uses his own character to contradict the pretensions of the New York intelligentsia and/or cognoscenti. Not that Isaac has his own life in order or has cured himself of a literary man's vanities. But he seems to know when to put on the brakes.

When Mary and his pal begin listing all the artists they've nominated for their "Academy of the Overrated," Isaac insists that all their choices are terrific artists and wonders why they didn't throw in Mozart while they were busy trashing everybody. When Mary begins prattling about all her friends who posses "genius," Isaac gets fed up and remarks, "Everybody's a genius; you should meet some stupid people sometime; you might learn something."

Better late than never. "Manhattan" has comic integrity in part because Allen is now making jokes at the expense of his own parochialism. There's no opportunity to heap condescending abuse on the phonies and sellouts decorating the Hollywood landscape. The result appears to be a more authentic and magnanimous comic perception of human vanity and foolhardiness.

In this film, Allen recognizes the comic fact that the discontents of well-to-do, cultivated people don't have much credibility in the larger scheme of things. Mary articulates this point when she complains, "I'm beautiful and i'm bright and I de* serve better," only to reverse herself a moment later and admit, "I guess I deserve everything I get."

New Yorkers who see their lives passing before their eyes in "Manhattan" may be tempted to experience a catharsis. Outsiders are more likely to have an uncomplicated good time contemplating the behavior of characters whose milieu may seem as remote but diverting as the settings of Shakespearean or Restoration comedy.

Like all classic humorists, Allen tends to reaffirm basically conservative attitudes. When Isaac speaks of his friends and himself as "people who constantly creat neurotic problems for themselves," he is not denying that the problems exist. He is suggesting that they can be overcome by trusting certain instincts.

Mariel Hemingway speaks Tracy's key closing lines, "What's six months if we still love each other?" and "You have to have a little faith in people," with such artless conviction that these reassuring platitudes ring with simple, indisputable truth and eloquence. It's apparent from Allen's beautiful reaction to her that Isaac has been blessed by this kid's emotional clarity, whatever becomes of their love affair. It's a stirring grace note to a delightfully astute modern comedy. CAPTION: Picture, Woody Allen and Diane Keaton in "Manhattan": Meeting on hostile ground, the two "seem more adroitly matched than ever before."