SMALLVILLE actress Allison Mack has pleaded not guilty after being arrested for her alleged role in notorious upstate sex slave cult NXIVM (pronounced Nexium), as horrifying details of her involvement have been revealed in court.

A gaunt, disheveled Mack appeared in Brooklyn federal court today on charges of sex trafficking and forced labor — a month after Nxivm leader Keith Raniere was collared on the same charges.

Mack, 35, was Raniere’s direct “slave” and had a sexual relationship with him — but also acted as a “master” to other slaves, who were forced to have Raniere’s initials burned into their pubic region with a cauterizing pen, according to the criminal complaint.

As the women were being branded like cattle, Mack allegedly placed her hands on their chests and told them to “feel the pain” and to “think of [their] master,” prosecutors say.

The actress first lured the women into the secret society within Nxivm known as “The Vow” — and cajoled them into providing “collateral” like embarrassing photos and statements to use as blackmail, prosecutors allege.

She then allegedly groomed the slaves for sex with Raniere — ordering them to adhere to extremely restrictive diets, to refrain from removing their pubic hair and to stay celibate, according to court documents.

“Ms. Mack was one of the top members of a highly organized scheme which was designed to provide sex to [Raniere],” Assistant US Attorney Moira Penza said in court Friday.

She also forced them to pose naked for photos — “including on one occasion close-up pictures of their vaginas” — which were given to Raniere and also used as collateral, the feds claim.

Mack and other slave “masters” allegedly made their slaves participate in “readiness” drills, requiring them to respond to requests at any time of the day or night so they were “seriously sleep-deprived.”

One of her slaves became so thin and tired that she stopped getting periods.

During today’s court appearance, it was revealed that Mack last year married Battlestar Gallactica actress and Canadian national Nicki Clyne, who was spotted hiding out in Mexico with Mack and Raniere when authorities tracked down the cult leader last month.

Dressed in a light jean jacket, light brown boots and black pants — and sporting dark circles under her eyes — Mack spoke quietly as she answered Judge Cheryl Pollak’s routine questions.

Pollak declined to release the actress from detention, saying her lawyers failed to offer a “sufficient” bail package given the serious charges. She said they could file a new petition Monday.

Mack’s attorneys argued that she’s not a flight risk because she returned to the US voluntarily from Mexico — but Pollak noted that she may not had been aware she’s facing a minimum of 15 years behind bars at the time.

Prosecutors want a high dollar figure posted by someone with no affiliation to Nxivm — which is bankrolled by the heiresses to the Seagram’s whisky fortune, who are also members — and home detention.

The whole thing operated like an extortion plot, with the women forced to follow his directions after revealing “highly damaging information about themselves or family members,” authorities charged.

Raniere, 57, who lived outside Albany, received financing for his twisted operation from Clare Bronfman, an heir to the Seagram’s liquor fortune, according to authorities. He was jailed pending an April 27 bail hearing.

Founded by Raniere in 1998, NXIVM offers “programs that provide the philosophical and practical foundation necessary to acquire and build the skills for success, it’s website reads.

Around 160,000 joined the group led by Raniere, who is known within its circles as “Vanguard”, including Mack, Battlestar Gallactica star Nicki Clyne and Dynasty star Catherine Oxenberg’s daughter, India.

Mack was reportedly introduced to the self-help group around 2006 by her Smallville co-star Kristin Kreuk.

Kreuk, who portrayed the young ­Superman’s love interest, Lana Lang, signed up, but got out before female acolytes began getting forcibly branded.

Mack played Clark Kent’s starry-eyed blond pursuer, Chloe Sullivan.

Kruik put out a statement after Raniere’s arrest saying she left the group five years ago, did not experience any nefarious activities and has denounced his alleged abuse of women.