The Soviet invasion of Afghanistan has added substantial momentum to the already growing campaign for a larger Japanese military power.

Government and political leaders sensitive to shifts in public sentiment say the trend is toward support for more military spending and public opinion polls show a growing approval of the existing defense forces.

Largely because of the Invasion of Afghanistan, a new and unusually pointed American insistence that Japan increase its military budget has generated a debate on how much defense spending there should be here. It has also placed Prime Minister Masayoshi Ohira in a difficult position because complying with the American requests could force him to make one of several unpleasant budget choices for next year.

Ohira's latest comments suggest that despite the growing pressures he will not propose a major increase of defense spending this year. To do what the United States suggests would require a major expansion in the budget in an election year, and Ohira is reluctant to tackle a tax increase. If pressed further during his May visit to Washington, Ohira will reply that it is a decision for Japan alone to make, he has said.

The controversy has brought the most intense discussion of defense policy since the 1950s when the U.S.-Japanese security pact was the focus of strident debate in this officially pacifist country.

The impact of Afghanistan on public opinion has been "quite substantial," said Michita Sakata, a prominent moderate member of the Liberal Democratic Party and chairman of a newly formed security committee whose inauguration last month was itself a reflection of the change in attitudes.

Afghanistan is considered outside the Soviet sphere, an independent Third World country, he said, and the invasion makes Japanese think about what might occur in their own country.

"We think, what might happen in Hokkaido?" Sakata said in an interview this week. Hokkaido is Japan's northermost island and is only a few miles from the four Kurile Islands where Soviets have placed substantial forces in the past two years.

Although its constitution renounces war and foreswears military preparation, Japan has built an armed force of about 260,000 persons. Lingering memories of World War II militarism, however, have prevented maintaining military forces of the size of the United States or Western European countries do, and Japan spends a far smaller proportion of its gross national product on defense than do those countries.

But promilitary sentiment has been building slowly since the mid-1970s, for several reasons. One is the fear that the United States, after Vietnam, would reduce its presence in Asia, leaving Japan vulnerable to Soviet pressures. Another is the fact that China now endorses Japanese rearmament after once fiercely opposing it. A third is the growing Soviet military presence in the Kuriles, coupled with Moscow's deployment of SS20 missiles and Backfire bombers in the Far East.

Recent polls measure the change. A sample conducted by the prime minister's office showed 86 percent of the self-defense forces, the highest support since the war.

An Asahi newspaper poll found 25 percent actually favor increasing those forces, as compared with only 18 percent 16 months ago. The increase was broadly based.

The American pressure has been usually direct since the Soviet invasion. Led by Defense Secretary Harold Brown, the United States for the first time is urging a specific level of defense spending on Japan. This runs counter to the usual State Department position.

Brown, to the delight of the Japan Defense Agency, wants an acceleration of that agency's "intermediate range plan," which envisions reaching by 1985 defense spending equal to 1 percent of this country's gross national product. This year Japan will spend about 0.9 percent of GNP, and 1 percent has traditionally been regarded as the maximum.

The Americans have pressed for an acceleration that would reach 1 percent by 1984. Defense planners are urging that goal on the Ohira government and the Foreign Ministry has joined in, eager to satisfy American requests before Ohira's visit to Washington.