When Patti LaBelle, Gladys Knight and Fantasia Barrino take the stage during the Tony Awards ceremony Sunday night, they’ll be there to showcase the new musical contender “After Midnight.” But they won’t be doing a number you’ll see in the show.

Instead, they’ll be performing in a new sequence that works the three guest stars — who have appeared or will appear separately in the production — into a full-cast mashup of two numbers from the musical. “It doesn’t exist in the show,” said director Warren Carlyle of the sequence. “It’s a Tony special.”

That kind of ongoing, freeform riffing seems in keeping with the spirit of the tuner itself, a jazzy take on a Cotton Club revue that reconfigures some of its production elements every time a new performer slips into the rotating guest-star slot. Each new star — including kd lang, Vanessa Williams and Toni Braxton, in the wake of original guest artist Barrino — has required new choreography, new costumes and, sometimes, new prop elements.

“It’s like being a doctor on call,” joked fashion designer Isabel Toledo, the show’s Tony-nominated costume designer.

The improvisatory style of jazz great Duke Ellington — whose years at the Cotton Club provide the inspiration for the show — seems to have guided “After Midnight” from the start. According to Jack Viertel, the City Center Encores! a.d. who conceived “After Midnight,” the musical began life as an amorphous idea for a project that would launch the new partnership between the nonprofit Encores! program and Jazz at Lincoln Center.

Wynton Marsalis, whose Jazz at Lincoln Center All Stars appear on Broadway as the production’s onstage orchestra, pushed for an Ellington theme, and the piece grew out of the 80 or so pieces of music he brought to the table. From the common themes in those tunes emerged the concept for a musical with the feeling of a floorshow, but with enough of a loose narrative to carry the audience on a journey from birth to death, and from innocence to experience.

With Carlyle (“Hugh Jackman, Back on Broadway”) on board as director-choreographer, the creatives went in search of performers with unique skills. Casting director Laura Stanczyk spent nine months drumming up an array of talent from TV stars (Dule Hill) to modern dancers (Karine Plantadit) to tappers (Dormeshia Sumbry-Edwards) to a memorable pair of hip-hoppers (Julius “iGlide” Chisolm and Virgil “Lil O” Gadson).

Then the creative team allowed the performers’ individual talents to dictate the shape of several numbers. For instance, a tribute to Earl “Snakehips” Tucker evolved into a showcase for the differing — and very contemporary — styles of Chisolm and Gadson. “I was picturing a straight-up imitation of Snakehips,” Viertel recalled. “But then we realized: What they’re doing is the modern-day equivalent. It’s is the great-grandchild of Snakehips.”

The show’s utopian vision of the Cotton Club through a contemporary lens won raves in its initial nonprofit iteration (then called “The Cotton Club Parade”) at City Center in 2011, and again when the musical returned for a second limited run in 2012. For all that success, however, the commercial transfer was another improvisation, when producer Scott Sanders added guest stars to the mix, combining the model of an ongoing Broadway musical with that of a limited-engagement concert run.

The Main Stem transfer proved as well-received as the early incarnations, making “After Midnight” (along with another fall opener, “A Gentleman’s Guide to Love and Murder”) one of best reviewed new musicals of the season. Awards love followed, with the tuner racking up seven Tony noms in total.

Despite all the critical praise, box office has proven relatively soft since the show opened Nov. 3. Guest stars haven’t quite brought the expected B.O. spikes, with the two-week stint of Braxton and Babyface Edmonds, who filled houses to about 90% of capacity, spurring the most obvious rush at the box office.

Pundits may consider chances to be slim for a revue like “After Midnight” to score the new musical trophy, but until the awards are handed out Sunday night, Sanders and company are capitalizing on the month-long window when the show can trumpet its status as one of four nominees for best new musical. Thursday afternoon saw the renaming of West 47th Street to Duke Ellington Way (pictured, above), just down the block from where “After Midnight” is playing. On Sunday, the appearance of LaBelle and Knight on the nationally televised Tony telecast is expected to help sustain the sales jolt prompted by recent news of the show’s summer guest stars — LaBelle, Knight and Natalie Cole.

Before then, of course, Toledo still has to finish LaBelle and Knight’s costumes, and Carlyle must polish up the Tony number’s choreography. But none of that will pose a problem. At “After Midnight,” they’re used to improvising.