The lightning strike that turned Barry Allen into the Flash has rubbed off on the CW.

The network that had endured a long slump comes to the Television Critics Assn. on Sunday with newfound sizzle and respect. The CW has ratings growth to tout — thank you “Flash” and “Arrow” — and traction in the prestige-TV arena with the plucky “Jane the Virgin.”

“It’s been a long process,” said CW prexy Mark Pedowitz. “We’ve had a strategy and we’ve stuck to that strategy.”

The signs of a turnaround are coming none too soon for the broadcast network that will mark its 10th anniversary next year. The CW faced the possibility of affiliate defections had the ratings slide continued and its programming remained narrowly tailored for a young female audience.

“There’s no question that affiliates felt we were too niche of a network,” Pedowitz acknowledged.

The CW’s affiliation pact with Tribune Broadcasting, its core station group with 13 major-market affils, expires next year. The new regime at Tribune has been publicly noncommittal about whether it will renew with CW, although Tribune boss Peter Liguori has been complimentary about the network’s gains this season. The two sides will likely get down to business discussing a new deal later this year, which should be good timing for CW so long as current trends prevail.

Pedowitz (pictured right with ‘The Flash’s’ Grant Gustin and ‘Jane’s’ Gina Rodriguez) notes that Tribune and other key affiliate groups were major contributors to the success of the fall launch by stepping up local promotional efforts for “Flash” and “Jane the Virgin” in particular.

“They did a terrific job in helping us get the word out, and that made us stronger,” he said. “A successful network makes affiliates successful, and successful affiliates help make a network stronger. It’s a symbiotic relationship. Tribune has been a terrific partner.”

Pedowitz is quick to point out that the gains of this season did not happen overnight. After the ABC alum took the reins of CW in April 2011, the net set out to broaden its audience base and bring more men to the table by going deep on genre and serialized shows — the kind of binge-able fare that allowed CW to strike life-saving content licensing deals with Hulu and Netflix.

The CW’s parent companies, CBS and Warner Bros., opened up their wallets and their vaults to help the network improve the caliber of its programming. Having access to Warner Bros.’ DC Comics properties, such as “Arrow” and “The Flash,” has been invaluable in reeling in male viewers. CBS TV Studios has delivered fresh faces and strong creative auspices in such shows as “Jane the Virgin” and “Reign.”

“The strategy that the parent companies signed off on a couple years back was that we were a high-concept, genre and serialized programming network,” Pedowitz said. “We knew we had to broaden out beyond our 18-34 viewership. We had lost men years back when ‘Smallville’ disappeared. Thanks to Warner Bros. and CBS we have been building back to a stronger position. This didn’t all happen in one year, but this is the (season) that it feels like everything is connecting.”

To wit, the premiere of “Flash” in October set a new record high for the net, drawing 6.8 million viewers in live plus 7 numbers, plus several million more views across CW’s digital platforms. “Jane the Virgin,” meanwhile, has charmed critics and is up for two top Golden Globe kudos on Sunday — for best comedy and lead comedy actress for star Gina Rodriguez. The show also was feted on Friday by the AFI as one of the top 10 TV programs in 2014, a laurel that will help propel “Jane” as an Emmy contender in the fall.

For the season to date, CW is up 14% in total in total viewers (2.2 million), which marks the net’s best showing since the 2010-11 campaign. It’s up slightly in adults 18-49 (0.9) and adults 25-54 (1.0) and is flat in adults 18-34 (0.8). Any traction is notable in a year when virtually every network, broadcast and cable, is grappling with the galloping pace of change in viewing habits, from new platforms to time-shifting alternatives that are elusive to traditional TV ratings measurement.

On a nightly basis, CW is up double digits in adults 18-49 and total viewers on Monday, Tuesday and Friday. Perhaps the most important stat of the season to date is that the composition of the audience is starting to balance out among male and female viewers, shifting to 40% male compared to 30% four years ago.

“The Flash” has delivered a big injection of viewers this season, which helped the net capitalize on the building blocks established during the previous two seasons by the programming team led by Thom Sherman. “Arrow,” “Reign” and “The 100” were key additions to the sked. The long-running “Supernatural” remains a workhorse, as does “Vampire Diaries” and “The Originals.” The much-hyped “Arrow”-“Flash” crossover episodes that aired in early December gave a boost to both shows and spurred sampling of other skeins.

Like every other network TV exec, Pedowitz is frustrated by his certainty that CW’s audience is larger than it appears in the traditional Nielsen numbers because of the high volume of digital viewing among its core audience. The output deal pacts with Netflix and Hulu helped shore up its revenue base, but advertising is still crucial, and that means that every fraction of a ratings point is crucial.

Pedowitz maintains that CW is drawing new advertisers — particularly in the automotive and financial service categories — and that it has been able to factor in digital viewing activity into its blurb sales.

“We have successfully monetized our digital (viewing) as part of our upfront play,” he said. “We are seeing growth in (advertising) categories that have either not been on our network or are coming back to us in bigger numbers. This is crucial for us.”

There are intangible benefits that come from ratings momentum and kudos buzz, as it boosts morale at the network and helps attract more talent. Pedowitz was effusive about the importance of working with top-flight showrunners, such as the “Flash”/”Arrow” team of Greg Berlanti, Andrew Kreisberg and Marc Guggenheim and “Jane the Virgin’s” Jennie Snyder Urman.

“At the end of the day, if you have quality programming, your show may or may not work, but at least you stand a fighting chance,” Pedowitz said. “To everyone’s credit, (CW producers) have really delivered.”