BUFFALO— Four years after a Federal judge ordered forced busing, the Buffalo public schools have come to be considered a national model of integration. 
Moreover, educators say, the schools here are the better for integration. 
The best thing that's happened to Buffalo is court-ordered desegregation,'' said the Superintendent of Schools, Eugene Reville. ''We've restored confidence in Buffalo public schools.'' 
Of the 531 school desegregation programs that James Barnes has been involved with as director of the Hartford-based National Education Strategy Center, Buffalo, he said, ''is right at the top, right at the very top.'' 
Integration has worked, national educators said, because parents and teachers received a major role in designing the city's 22 magnet schools; because millions of dollars in extra Federal funds were available to make the magnet schools special, and because a Federal judge brandished a court order that kept things moving. 
School officials sold integration in Buffalo, which is about 40 percent black, by promising a better school waiting for children at the end of the bus ride. 
They spent tens of millions of dollars creating 43 full-day prekindergarten programs that hooked many parents on public schools early. And they set up magnet schools reflecting virtually every philosophy in education, from the progressive to the traditional. 
The ''velvet steamroller'' is how it is described here, where school officials have crafted a system of magnet schools so appealing that of the 30,000 students who were bused four years ago, only 15 percent had to be ordered onto buses by the Federal judge. Nearly one of every three Buffalo schools is a magnet school. 
The magnet-school idea was first tried in this country in the late 1960's to ease desegregation in Detroit. The goal was to create schools so special that students would be pulled - as if by magnets - from all parts of the city, even if it meant riding a bus. 
Magnet schools have always worked best where there is the threat of court-ordered busing, said Gordon Foster, director of the Miami Desegregation Center, a nonprofit federally financed institute. ''Buffalo's a prime example,'' he said. 
Judge John T. Curtin of Federal District Court, who has presided over the integration case, said: ''I'm distressed by people who make statements nationally that integration doesn't work. It does work. It's plain wrong to say it won't. It's worked in Buffalo.'' 
Integration was a long time coming here. Twenty years ago the New York Commissioner of Education made the first of many unsuccessful attempts by the state to persuade the schools to desegregate. 
Nine years ago, after black leaders filed a Federal suit, Judge Curtin stepped in and issued his first desegregation order; eventually there would be four. In the first phase, magnet schools were opened; in the last, the judge ordered busing to complete the integration. 
And there are still some problems: Federal and local cuts in funds threaten magnet programs; teachers at nonmagnet schools complain that their programs are neglected, and a few of the city's 75 schools remain segregated. Improvements in System Serve as Model for Others Today everyone, from the black leaders who filed the Federal suit to white parents who swore their children would never ride a bus, agrees the results are impressive. 
Test scores are up. While in 1976 the average Buffalo third grader scored at the 45th percentile in mathematics on the state pupil evaluation test, the average score five years later was at the 69th percentile. 
And this year Buffalo has the only educational system in New York with two schools on the State Education Commissioner's list of 20 top secondary schools. One of those Buffalo schools is the science magnet, or the Zoo School, which, no matter how it sounds, is unique - a school at the Buffalo zoo with a curriculum built around zoo animals. 
Several months ago two dozen Japanese educators flew to Buffalo to see how such magnet schools work, and they were followed last month by a dozen superintendents from southern school districts. 
A few weeks ago, when a United States Justice Department lawyer involved in the prolonged school desegregation suit in Yonkers was looking for programs that might work there, he visited Buffalo. 
Each year for the last five years, 300 to 400 white children have left private and parochial schools here to attend integrated public schools. 
Those children have helped balance a slight growth in the city's black population. When Judge Curtin intervened nine years ago, the schools were 43 percent black; now they are 47 percent black. Integration has not caused the dramatic white flight experienced in other cities. 
These days Buffalo school officials say their biggest worry is not protests about busing or racial conflict, but fighting the fund cuts that threaten magnet-school programs. 
In 1981 Buffalo received $7.4 million in Federal desegregation funds, the most for each student of any system in the country. But that dropped to $950,000 the next year, with Reagan Administration budget cuts, and while the state has increased desegregation aid to Buffalo, it is still well below the 1981 level. Appeal of Magnet Schools Starts With Their Variety Variety has made the magnet schools work. Buffalo now has the largest public Montessori school in the country, and it has Traditional High, where there is mandatory nightly homework and a dress code (shirts with collars for boys, no earrings for boys, and no jogging suits for boys or girls). 
Nor did Buffalo limit its magnet schools to the academic elite. Admission to the Zoo School is by lottery; 70 percent of the zoo students are considered poor and get federally subsidized lunches. 
Officials took East High School, an all-black inner-city school once considered among Buffalo's most troubled and spent $4 million turning it into the Buffalo Vocational-Technical Center, which today is an integrated school with a long waiting list. 
When Denise O'Mara, a white high-school junior from the Irish section of town, heard she would be riding a bus to Voc-Tech, she was delighted - it meant she had been accepted to the word-processing computer course she wanted so badly. She does not remember the time in the late 1970's when there were no whites in the school. 
But the principal, Bill Bennett, remembers. ''This will only continue if we can keep our equipment up to date,'' he said. ''You can't update unless you have bread. Money is everything, everything is money.'' 
Judge Curtin remembers, too, and is openly critical of the Reagan Administration's recent attempts to block Federal funding for magnet programs. Last year Congress appropriated $225 million for magnet schools, but the money has not been allocated by the Federal Department of Education. 
Last week Senators Daniel Patrick Moynihan, a Democrat from New York, and Orrin G. Hatch, a Republican from Utah, led a bipartisan protest that helped to get the application process for those funds going. But when the money will be available remains unclear, according to a spokesman for Senator Moynihan. 
''Of course it's discouraging,'' Judge Curtin said in an interview in his chambers. ''It could be a terribly disastrous thing.'' 
The schools have been a bright spot for a city - New York State's second largest - that has had more than its share of troubles. Since the closing of the Bethlehem and Republic steel plants in the late 1970's, unemployment has been high, and many of those who could afford to left the area. 
The population is 325,000 today, half what it was in the 1950's. And of the five largest cities in New York State, Buffalo has the highest percentage of people below the poverty level - $10,610 inyearly income for a family of four. Even with the extra desegregation aid, the spending for each pupil here is about 15 percent below the state average. 
''In a community like ours, we've had a number of setbacks,'' Judge Curtin said. ''The one thing I'm convinced, the school system is much better than 10 years ago or 20 years ago.'' Small Victories Won In Schools and at Home It was the power of the magnet schools that converted Carol Holz from a leader of the South Buffalo Antibusers 10 years ago to an enthusiastic supporter of integration today. 
For the longest time, Mrs. Holz said, she had prayed to St. Jude - the Roman Catholic patron saint of impossible causes - asking that her children never be bused out of their Irish working-class neighborhood. She and her husband, Dick, went to hundreds of meetings and promised trouble if their children were bused into black inner-city and East Side neighborhoods. 
And then one day several years ago, she said, one of her sons came home and told her about a new magnet school he wanted to attend. ''It was devastating,'' Mrs. Holz said. ''Here I was opposing busing, because I was trying to do what's best for my kids, and they were telling me something different.'' 
In time, she said, she was willing to give the magnet schools a try, but she still had a problem: ''My problem was, 'How will I tell Dick?' '' 
The day she broke the news to her husband, a steelworker, sitting right in the room with them, giving moral support, was the associate superintendent of schools, Joseph Murray. 
''Dick said, 'We'll try it, but if one thing happens to my kids. . . .' '' Mrs. Holz recalled. 
Mr. Murray knew how important this little husband-wife talk was for Buffalo. ''Carol Holz was a big win,'' he said. 
Mrs. Holz's son went from an all-white neighborhood school in South Buffalo with 30 in a class to an integrated inner-city magnet school with 18 in a class. 
''He was getting hot lunches,'' she said. ''We never had that in South Buffalo. There were brand-new books and materials - and a library you wouldn't believe.'' 
School officials acknowledge that the court order gave them extra money and a built-in political excuse to modernize an aging, deteriorating system. 
The general school-age population was shrinking in Buffalo - as it has been nationally - and two dozen old neighborhood schools needed to be closed. That would have caused political turmoil even without integration. 
''This way,'' Judge Curtin said, ''they pointed to the judge and said, 'He's a tyrant; he's making us do it.' '' 
In remaking their schools, leaders picked and chose among innovative methods that had proved successful elsewhere. 
In 1980 the Early Childhood Centers opened, for children too young for kindergarten through second grade. These schools used new screening, reading and math programs suggested by the Federal Education Department - programs tried in Peotone, Ill.; Mobile, Ala., and Boulder, Colo. For each teacher at the centers, an aide was provided. 
There have been successes never anticipated. Of the 186 kindergarten pupils this year at Early Childhood Center 54, for example, all but 21 are reading. ''It wasn't our intention to teach kindergarten kids to read,'' said the principal, William Fairlie, ''but as a result of them being here in the new pre-K program, we saw they were ready.'' Students and Teachers Inspired by Changes Parents here can now go shopping for a school to suit their child's temperament. Nicole Skorka, a fifth grader, started at the Montessori school, where children are encouraged to develop at their own pace and to rove the halls freely and play on the floors. 
This was the wrong place for Nicole, and she was miserable. She has since transferred to Campus East, another magnet school, where discipline and basics are the law. ''Oh, this school is good,'' Nicole said. ''All you do is sit in your seat and work.'' 
Teachers, too, welcomed the magnet-school program. Suddenly they were being asked to create new courses to attract students. 
Joe Carden had first tried to set up an advanced computer-accounting program 22 years ago, but not until the Buffalo Voc-Tech magnet school opened five years ago did he get the go-ahead. ''If it wasn't for integration,'' Mr. Carden said, ''I wouldn't have supplies, I wouldn't have equipment, I wouldn't have the motivated students.'' 
In the first year of his business course, he now teaches what used to take two years. 
Like the students, teachers apply to schools that suit their philosophies. A mathematics teacher, Mark J. Walter, who likes a structured setting, switched from a regular city high school to Buffalo Traditional five years ago. ''I'm on safer ground here,'' he said, ''just like the kids - they know what's expected and so do I.'' 
At Buffalo Traditional he advises the math team and engineering club. At his previous school he was not involved in after-school clubs. 
None of this is to say there are no problems. Though Buffalo has a higher proportion of magnet schools than most places, many students and teachers still find that the magnet schools they want are filled. This year 10,000 students applied for 2,200 openings. 
Teachers at nonmagnet schools complain that their schools suffer to make the magnet schools shine. ''The magnet programs are the finest anywhere,'' said the president of the Buffalo teachers union, Philip Rumore, ''but it's time to stop creating new magnets and start building up neighborhood schools.'' 
Many students wind up at city schools like Kensington High because they were not accepted into a magnet program. The school, which is two-thirds minority, has had difficulty attracting whites. ''Sometimes students come here feeling they're the rejects,'' said Mary Grace Demarse, a guidance director. 
Also, since the Federal cuts, school leaders and the Mayor, James Griffin, have fought over appropriating extra money for integration. Two years ago Judge Curtin ordered the city to give the schools an extra $7 million, and a request from school officials for $30 million more is before him. 
School officials and the judge find that keeping the system racially balanced takes constant tinkering. The judge's order says the schools must be between 30 and 65 percent minority, and every year school officials add what they call ''mini-magnet'' programs to adjust the racial balance. 
''Pleased?'' said Judge Curtin. ''Yes, but the school system is like most things in life; it calls for attention all the time. People want instant results. For heaven's sakes, it takes a while.'' Though he still has jurisdiction in the case, the judge has not been yelled at by parents in a long time. They used to go to his home, write him notes and phone him in the middle of the night. 
In the South Buffalo section, where the judge grew up, they called him the ''little fool'' for some time - he is not very tall. ''But you don't hear that much any more, Mrs. Holz said. ''I'd say people respect him now.'' 
Occasionally someone even thanks the judge. Once in a while school children invite him for a visit or send him a gift. The Futures Academy magnet school, a career-oriented program, gave him the key to the school. The children at Early Childhood Center 90 made a bright yellow piggy bank for him. Both schools, once all black, are now integrated. 
The judge said he found these school visits ''a very moving experience.'' 
photo of the Zoo School in Buffalo (NYT/Joe Traver) (page B4); photo ofJudge John T. Curtin (NYT) (page B4)