The comparisons were inevitable: two guys who became a national punchline after being caught in sex scandals make a bid for a political comeback from disgrace.

Mark Sanford Mark Sanford

But once you get past the astonishment and the snickers, the differences are more significant than the similarities between Mark Sanford, the Republican former South Carolina governor elected in a landslide to his old House seat earlier this month, and Anthony Weiner, the Democratic ex-congressman who formally launched his bid for mayor of New York on Wednesday.

It is true that both pose tests of the electorate’s capacity for forgiveness. But Sanford had a set of advantages that Weiner does not.

For one thing, the voters in his district had a longstanding history with him. Most of them had seen Sanford’s name on a general election ballot five times before—three of them for the same office that he sought in the May 7 special election.

Weiner, on the other hand, is seeking a post he has never held--and support from voters, with the exception of those in certain neighborhoods of Brooklyn and Queens, whom he has never represented.

Anthony Weiner Former congressman Anthony Weiner.

And the two scandals took different arcs.

Sanford, once it became clear that he had not been hiking the Appalachian Trail, pretty much owned up to where he had really been and the truth about his relationship with Maria Belen Chapur. Weiner continued to deny that the crotch photos sent through his Twitter account were in fact of his own crotch, even as the falsehood became more and more transparent.

And where Weiner was forced to resign, Sanford remained in office, surviving an effort to impeach him, paying the largest ethics fine in South Carolina history, and ultimately enjoying the most productive period of his governorship. Indeed, he left office in 2011 on something of a high note, with approval around 55 percent—which, as the Charleston Post and Courier noted at the time, made him more popular than half the nation’s governors.

Then there are the differences in the two offices. In a staunchly Republican district, Sanford ran as an unapologetic conservative for the House, an institution known for its hard ideological differences. But when people vote for local office, they are far more likely to look beyond partisanship to find someone who offers concrete solutions to their most immediate problems. Weiner made his reputation not with his legislative achievements, but by doing partisan battle on cable news channels.

And finally, there are the circumstances in which they decided to run.

A unique opportunity presented itself for Sanford when his old congressional seat suddenly became vacant in December, with the appointment of then-Rep. Tim Scott ( R ) to the Senate, to replace the departing Jim DeMint ( R).

“It’s sort of a generational event. It never happens in South Carolina politics. A U.S. senator retires, and then a governor appoints, and then my phone lines light up,” Sanford told the Washington Post in February.

A special election meant  a short campaign—and in Sanford’s case, a large and weak field of rivals in the GOP primary, then a newcomer to politics in the general election. Though the national Republican Party turned its back on him, much of his battle-tested political network at home rallied behind him.

Weiner, meanwhile, is going to have to prove himself in a prolonged campaign, with few allies, and against a seasoned field of opponents.

Though Sanford’s experience suggests that politics still holds the potential for redemption, Weiner’s is going to be a far more difficult path.

Gallery: Scandal-plagued politicians then and now.