Cuban President Fidel Castro today called the Camp David accords "unjust" and "dirty," compared South Africa to Nazi Germany and denounced "Yankee imperialism" and its "dirty scheming" to malign Cuba as the host of the sixth summit of nonaligned nations.

Castro's remarks, in a speech opening the summit, prompted a walkout by U.S. and Chinese diplomsts who were invited to the opening ceremony along with the rest of the local diplomatic corps.

Declaring that "we are not fanatics," Castro denied charges by some nonaligned members that he is trying to pull the movement into the Soviet sphere, and said Cuba's own government is "completely independent."

While he said Cuba was a friend of the Soviet Union and believed that all nonaligned countries should be, Castro declared that Cuba would respect the movement's independence during the three years of its chairmanship.

There was no clear count of how many heads of state or government leaders were in attendance, but estimates ran to more than 50. The largest summit conference in recent history welcomed some old faces like Yugoslavia's President Tito, Zambian President Kenneth Kaunda and Jordan's King Hussein.

Among the new faces, many owing their presence to recent coups or revolutions, were Ghana's Lt. Jerry Rawlings, wearing the Air Force uniform and cap in which he overthrew that country's government early in the summer; Ugandan President Godfrey Binaisa; President Nur Mohammed Taraki of Afghanistan and, in a formal white robe, President Zia ul-Haq of Pakistan.

Among the six new movement members added last week, Nicaragua was represented by two members of the revolutionary junta that replaced dictator Anastasio Somoza in July, and Prime Minister Maurice Bishop, who led Grenada's ouster of Eric Gairy in March, took that country's seat.

Conspicuously empty were the seats for the Cambodian delegation, which are disputed by two different groups contesting the government. The seats