House and Senate conferees yesterday reached a compromise agreement on a major farm bill giving wheat and corn growers higher price supports and payments, but at levels which congressional sources said should prevent a presidential veto.

Administration officials had warned that President Carter would probably veto the measure if it contained the farm payments approved by the Senate. Agriculture Secretary Bob Bergland visited the conferees to stress that the administration was admantly opposed to the higher Senate levels.

Administration sources said that the figures agreed on would probably be acceptable fo the White House.

The compromise measure adopted yesterday calls for a subtantial rise in benefits to farmers in 1978. It is unlikely that the measure wull have any substantial impact on the cost of bread, however. Should demand for wheat and corn remain at the present slack levels, though, farmers could be eligible for increased direct payments from the federal treasury to cover their costs of producing grain.

The price support levels are to rise less sharply than the "target price" payments, which the government makes to farmers to cover those costs. The administration has been wary of rising price supports too rapidly for fear of pricing American grain out of competition in world markets. The purpose of the conferees' measure is to maintain farm income through direct payments to circumvent that fear.

If the measure becomes law, price supports on wheat will rise from the present $2.25 a bushel to $2.35 a bushel in 1978. Corn price supports will go from the present $1.70 a bushel to $2 a bushel.

The heated, five-hour debate in yesterday's conference centered on the level of direct payments to farmers to cover their costs. The Senate had sought a $3.10 a bushel guarantee, but the House had approved only $3 a bushel. Both figures were substantially above the present wheat target price of $2.47 a bushel.

The conferees compromised on $3.05 a bushel, but that would drop to $3 a bushel if the 1978 wheat crop exceeds 1.8 billion bushels. Predictions are that the crop will total slightly more than 2 billion bushels.

Administration economists had warned that the extra 10 cents sought by the Senate would cost $100 million in direct payments to farmers.

The farm bill covering the 1978-81 period, also provides flexibility to the Secretary of Agriculture to lower price supports by up to 10 per cent under some circumstances.