The leader of the alleged upstate cult Nxivm pleaded not guilty in Brooklyn federal court Friday to charges that he kept women as sex slaves and branded them like cattle — while his accused cohort, “Smallville” actress Allison Mack, tried to wriggle out of attending their next hearing.

Keith Raniere appeared in the courtroom with graying shoulder-length hair and a freshly shaven face as he stood alongside Mack, his co-defendant and alleged “slave master.”

His lawyer, Marc Agnifilo, told Judge Nicholas Garaufis that his client pleaded not guilty to the charges of sex trafficking, sex-trafficking conspiracy and forced-labor conspiracy.

Mack is being tried with Raniere but had already pleaded not guilty to the charges.

The TV actress’ lawyer, Sean Buckley, asked that her next court appearance be waived.

Garaufis refused.

“People have to show up,” he chided. “This is a very serious matter.”

The judge set the pair’s trial date for Oct. 1. Their next hearing is scheduled for June 12.

Prosecutor Moira Penza added that a superseding indictment with more charges and defendants could be filed next month.

Mack, 35, said nothing as she left court. She remains out on $5 million bail. Raniere, 57, who was busted in Mexico in March, is being held without bail.

They each face 15 years to life in prison if convicted.

Nxivm (pronounced Nex-ee-um) billed itself as a self-help group while attracting high-profile figures, including India Oxenberg, daughter of “Dynasty” actress Catherine Oxenberg.

Raniere is accused of running workshops at a compound 20 miles outside of Albany during which he taught women about “the need for men to have multiple sexual partners and the need for women to be monogamous,” a criminal complaint charges.

He was known as “Vanguard” to his “Nxians” — followers who plunked down up to $10,000 for five-day seminars as part of Nxivm’s Executive Success program, according to reports.

They would bow to the charismatic Raniere, who forced them to recite a 12-point mission statement that he wrote, Forbes magazine has reported.

“There are no ultimate victims; therefore, I will not choose to be a victim,” one point read.

Mack is accused of recruiting and grooming women as sex slaves, forcing them to remain thin and practice celibacy.