The battle for the mayor's office here has cast an unusually harsh light on the role of paid campaign consultants in today's politics. The "hired guns" have stirred a controversy that will last beyond Tuesday's voting.

In the final week of this contest, voters could be forgiven for being confused. The names on the ballot are Harold Washington, Democrat, and Bernard E. Epton, Republican. But to judge from the headlines and the television stories, the real contest is between William Zimmerman and John Deardourff, the media consultants for the two campaigns.

Zimmerman came uninvited to a press briefing where Deardourff was showing his new TV spots, and accused his Republican counterpart of being "a disgrace to the profession we both practice." The two exchanged charges of exploiting racist sentiments. It added a tawdry touch to a campaign that is already notably lacking in grace.

Both men created commercials that were negative, accusatory, derisive. Deardourff's early spots dwelled heavily on Washington's record of tax evasion and his temporary loss of his law license. The tag line, "Epton for Mayor --Before It's Too Late" seemed to many a lightly coated message to whites to resist the election of the city's first black mayor.

Zimmerman, in turn, showed his contempt for Epton by depicting him as a marionette, whose strings were being pulled by President Reagan and Illinois Gov. James R. Thompson.

All of this media manipulation has been drawing criticism from the Chicago papers and television stations, which accuse the outside consultants of exacerbating an already tense situation in the city.

There is a degree of hypocrisy in the charge. You can walk down any street in Chicago and find cartoons, buttons and graffiti attacking Epton and Washington in far more scurrilous terms than anything Deardourff or Zimmerman would think of putting on the air.

And yet, one can understand the distaste for the commercials. Unlike the people in the neighborhoods, Deardourff and Zimmerman do not have to live with the aftermath of this campaign. Chicago's future will not be their responsibility.

In talking of the consultants, one should make clear it is their role, not their character, that is subject to question. Deardourff happens to be a liberal Republican, a strong advocate of civil rights and equal rights, and a man who has had several black clients. But it is clear beyond challenge, I think, that the slogan he chose for this campaign crystallized and legitimized hostility based on Washington's race, even if, as Deardourff maintains, it was intended only as a reference to Washington's personal history.

In the last 25 years, as TV's role in politics has expanded, so has the influence of the "hired guns." Tearing down the opposition is, for them, often the easiest way to win an election, and they bear a responsibility for the increasing negativism of campaigns. Their type was relatively unknown in Chicago, where, for years, "the word" was delivered by Democratic precinct captains.

It is only as the machine has splintered here --as it did most other places much earlier-- that the media consultants have taken over. Maverick Mayor Jane Byrne employed outsider David Sawyer in her unsuccessful bid for renomination in the February primary, and the filmmaker conveyed such a striking change in her combative personality that one critic said he must have "sedated" her.

But Byrne and Richard M. Daley, splitting the white vote, gave Washington a narrow plurality victory. And the puny Chicago Republican Party (with encouragement from Thompson) asked Deardourff to show it how to exploit its best chance in 50 years to capture the mayor's office.

Both candidates are novices in big-time, big-dollar television politics, and that has given Deardourff and Zimmerman unusually free rein to "do their thing." There is no way to ban the "hired guns" from marketing their services far from their home bases. The remedy for the sort of heedless, reckless negativism that they seem to find as the easiest way to do their job has to be sought from the people who hire them and pay them.

Responsibility must rest with the parties that nominated these candidates and hired these consultants. Where you have a healthy political party, it accepts the duty of disciplining its own "hired guns." Where you have a shattered party fighting a shadow party, as in Chicago, you get the kind of mess that Chicagoans rightly resent.