Serial sexter Anthony Weiner’s wife partly blamed herself last year when her horndog husband confessed to her that he was at it again.

Friends and family told People magazine that Huma Abedin was kicking herself at the time for bailing out of couples counseling and focusing more on their newborn baby boy.

But, thanks to a new round of joint therapy that continues even now, the couple was able to put the relapse behind them.

“They really became a unit, and she feels much closer to Anthony now,” a relative told the magazine.

That’s a long way from how Abedin felt during her worst days when she stood in the doorway of their home, torn about what to do.

“She was seriously thinking, ‘Maybe I can’t do this.’ There was the possibility of leaving on the table,” the family member said.

Abedin and Weiner had let close relatives know they might split.

“It would have been perfectly logical if she had said, ‘I’m out of here,’ ” a friend, Rory Tahari, told the magazine.

“Any woman could have understood that.”

The worst moments included a Hamptons vacation 12 months ago when she suffered from painful isolation that put even more stress on their marriage.

“All the parties they had once been invited to, Huma was now invited but Anthony wasn’t,” a family member said. “It was a difficult time.”

Then it got worse. A month later, according to the couple, Weiner confessed to her that he had continued to text lewd pictures of himself. He said he also told her that he had frequent phone sex with one woman, 22-year-old Sydney Leathers, and sexting sessions with two others under the pseudonym Carlos Danger.

It was Leathers who eventually went public with Weiner’s nude photos and graphic messages, a revelation that revived the sexting scandal and sent Weiner’s poll numbers plummeting.

But it wasn’t politics or Weiner’s ambition that kept Abedin by her husband’s side. It was their son.

“Huma has a very strong moral character, and she made a commitment for better or worse,” Tahari said.

“She never wanted Jordan to say to her, ‘Why didn’t you do everything you could to help Dad?’ ”

But it hasn’t been easy. When the news broke that the mayoral candidate continued his sexting habit even after he resigned from Congress, Abedin found herself crying to friends.

Huma has tried to hide the tears from her 19-month-old son.

“He is the light in her life, and that’s what she was focused on. She needed to pull herself together,” the friend said.

Despite her choice to stick it out, the Good Wife is anguished over people second-guessing her decision and by friends — including the Clintons — who have forsaken her husband.

“No one wants to see Huma go through this,” a source close to the Clintons told the magazine.

“They are done with him. As part of caring about Huma, neither would shed a tear if he left the race and went away.”

For now, Abedin is the only one going away. She is taking an extended vacation from working with Hillary Rodham Clinton.

Abedin, who just turned 38, plans to be active in the campaign, but it is unclear what her role will be.

Her presence could stir more scandal talk, but her absence may make her look unsupportive as she tries to repair her own credibility.

“Every day that she alluded to his problems and said he’s a better man and it’s in the past, she was taking it too far,” a close friend said. “She knows that.”

But another friend said it is good to hear her cry.

“What worries me about her is this feeling that she has to be what everyone thinks she is,” the friend said. “Some steely superhuman.”