Between a glamorous turn-of-the-century gala in NYC, a blood-soaked ball in Victorian London, a wintertime wedding in 1920s Yorkshire, a sexy ’60s Midwest soiree, and a sojourn through a medieval fantasyland, this year’s five Emmy nominees for hairstyling for a single-camera series faced many a hair-raising challenge. But as all five of the nominated head hairstylists say, the chance to flaunt period coifs that have taken months to perfect was worth the sleepless nights and 12-hour days.

From dinner at the Ritz to a hospital board meeting, an engagement celebration at a castle to a Christmastime wedding at Downton Abbey, “all the scenes really helped showcase the variety of hairstyles from a different period of time,” says Nic Collins of “Episode 9.” The series finale culminated with a New Year’s celebration that bid adieu both to 1925 and the beloved PBS show.

One of the surprise stars of the farewell episode was the hairdryer, which debuted at Downton and inspired Daisy to cut her hair into a Dutch bob akin to Lady Mary’s sleek shingle bob, which was also written into the show at Collins’ suggestion.

“We presented the evidence; Julian created the storyline,” says Collins of Julian Fellowes, the show’s writer-creator. “He’s an amazing writer. And it’s a joy to help the storylines based on the research. The hairdryer is a great way to show this changing world.”

Another high-fashion hallmark of the episode was the headband. “It was inspired by the Tut mania at the time,” says Collins, who took home the Emmy last year. “A married woman always wore a tiara inherited from her husband’s family as a show of wealth. The headband was the perfect look for the liberated woman of the ’20s.”

Department head hairstylist Kevin Alexander says “The Door” was an artistically demanding episode that featured “scenes from nearly all the lands we visit in the show.” The most challenging part was perfecting the look of the children of the forest.

“Creating the wigs for them — then making them work with [prosthetic designer] Barrie Gower’s brilliant designs — was so exciting and away from anything else I’ve done on the show,” Alexander says.

To that end, he experimented with “everything from modern wigs to horse hair to suede cap bases designed to look like animal skins” to crown the heads of the ancient forest folk.

Though demanding, Alexander says the episode beautifully showcases his team’s hard work. “I work very closely with Michele Clapton, our costume designer. I take inspiration from her designs and the silhouette of the costumes,” explains Alexander, who also conducts his own research to create exotic combinations. “I reference everything from the medieval period to different African and Indian cultures to old ’80s fashion shows to present-day trends.” After all, says Alexander, “we are a fantasy show.”

An elaborate gala ball sets a resplendent stage on which to view all the main characters — and their finery — in “Williams and Walker,” an episode named for the real life vaudeville duo Bert Williams and George Walker.

“For most of the show, you see a lot of nurses’ caps and hats. The ball takes place at the Waldorf Astoria, so the hair had to be very detailed,” says the Cinemax drama’s department head hairstylist Jerry DeCarlo. “Each look had to be individual. We knew we would see it from every direction, so all the hair ornaments had to be carefully placed.”

To assist in achieving the society ladies’ voluminous Gibson girl buns, DeCarlo used hairpieces, switches and “rats” — balls of hair women saved from their hairbrushes to achieve the Pompadour poufs.

“At the time, hair was extremely long, because by the time you braided and twisted it up, it shortened the length,” says DeCarlo, who led a team of 19 stylists to coif the climactic scene.

For tools, DeCarlo used a combination of conventional and original methods, including Marcelling irons (“to create the finger waves”), hairpins (“bobby pins weren’t invented until the 1920s”), and, for the guys, pomade. “We used some of the original products, which you can still buy!”

“Working on a period show is challenging every day,” says Mary Ann Valdes, department head hairstylist on the ’60s era Showtime drama. Throw in a party — in this case, when Dr. William Masters (Michael Sheen) is invited to be a guest speaker at Washington University — and the workload is multiplied.

“All the background has to be period,” Valdes says of the extras who populated the pivotal scene in the episode “Matters of Gravity.” “When we have guest stars, we have to deal with modern haircuts, be it adding extensions or putting wigs on. Once, we had too many blonds.”

Not that Valdes tires of translating modern styles into vintage ’dos. “I thrive on the research,” says the six-time Emmy nominee. “I love looking through books and movies and old magazines and finding something that works perfectly in the scene.”

Some of her favorite muses include Natalie Wood, the inspiration behind Lizzy Caplan’s Virginia Johnson, Barbra Streisand (Annaleigh Ashford’s Betty DiMello), and Stefanie Powers and Marlo Thomas, who both inform the look of Masters’ wife, Libby (Caitlin FitzGerald). “For the guys, it’s Rock Hudson. I start researching that time period and things just jump out at me.”

The crowning scene of the Showtime thriller’s “Glorious Horrors” episode comes when the ceiling rains blood on the guests of host Dorian Gray (Reeve Carney).

“We all discussed this episode months before,” says department head hairstylist Ferdinando Merolla. “We conducted ‘blood tests’ on the wigs and on actual hair because we were afraid it would stain — and how could we reproduce continuity from previous days if so?” Being that scenes are not always shot in sequential order, this would have proved a major headache.

“Every department was so nervous about this one, which took six days, 12 hours a day, to film,” says Merolla, who stepped in this season to replace Stefano Ceccarelli, who died last year. In terms of inspiration for the show, Merolla followed the template established by his predecessor: “Victorian London society with gothic horror influence.”

If Eva Green’s character Vanessa Ives stood out in the episode’s blood-curdling scene, it was intentional. Merolla says: “Vanessa’s hair was looser for the ball, because we wanted it to feel that she was different from everyone else — not so uptight and conformed. We also wanted to achieve the feeling that she was slowly unraveling.”