The CW teen drama “Riverdale” is famous for two things: its earnest portrayal of “Archie” comicbook characters and its countless scenes of gratuitously shirtless young men with chiseled abs who sometimes fight crime and solve mysteries.

For the ripped abs we can thank Alex Fine. The 25-year-old personal trainer bulked up several of the show’s stars, including KJ Apa (Archie) and Charles Melton (Reggie), taking their characters, in just a couple of years, from sensibly toned teens to eight-packed brawny bros.

Fine, who in his spare time is a competitive bull rider, says he’s yet to watch a single episode of “Riverdale.” Even so, he can see why its producers feature so many scenes of bare-chested guys.

“They’re pretty ripped,” Fine tells The Post of Apa and Melton, whom he met through one of his first clients, Mark Consuelos, who plays a mobbed-up dad, Hiram Lodge, on the show. To date, Fine’s been hired by just about every actor on “Riverdale,” including Cole Sprouse, Casey Cott and Hart Denton, plus some actresses he’s not authorized to name, he says. The show’s midseason finale will air Dec. 12.

The “Riverdale” teens aren’t the only famous bodies he’s helped sculpt. In the three years since the Ohio native dropped out of Central Michigan University where he played football and moved to LA to pursue his dream job, he’s worked with football greats Odell Beckham Jr., Marshawn Lynch and Reggie Bush; Jennifer Aniston and a bevy of models, including Victoria’s Secret fave Devon Windsor.

“I do things kind of unconventionally,” Fine says of his work with celebrities, all of whom come from word-of-mouth referrals. “A lot of [trainers] might be scared to push them to their limit, but I can push them to the level they need to get to.”

For the “Riverdale” actors, that meant getting them screen-ready for scenes such as this season’s prison plotline, in which (spoiler alert!) Archie finds himself thrust into an underground fight club in a corrupt juvenile-detention center. It so happens that Fine favors prison-style workouts to get his actor clients into shape, using pullups, pushups and basic weight lifting — with the kind of minimal equipment you might find in a stereotypical jailhouse gym.

“With KJ, we did a lot of that, and weights with really high repetitions,” Fine says. “We did a lot of chest and shoulders — with actors, you want to stick with chest and shoulders — since on-camera, it looks better.”

Fine also focused on helping Apa get a lean waist by weaving high intensity cardio exercises into his weight training. That includes intervals on an “assault bike,” or a stationary bike, which the user propels by pumping his or her arms. Fine tops it off with about 10 minutes of core workouts a day, such as planks and situp-style moves.

At the height of their time together, Apa was doing two 90-minute workouts per day, says Fine, who usually joined Apa for the sessions. “We push each other pretty hard.”

Fine gets close with the clients he works with — for better or for worse. Once, when he and Arizona Cardinals offensive guard Justin Pugh “had a few drinks” together post-workout, Pugh bet Fine $500 that he couldn’t become a professional bull rider in less than a year. Fine took him up on that, driving two hours north of Los Angeles to a bull-riding facility to train several times a week.

“And then I was actually pretty good at it,” Fine says, with a laugh. He lost the bet — “I broke my shoulder and tore my groin four months in” — but, after he recovered, he continued to train.

The kind of camaraderie that can lead to silly high-stakes bets is what makes Fine stand out from other trainers, his clients say. Melton, who plays the jacked jock Reggie on “Riverdale,” lost nearly 30 pounds and gained muscle definition in a matter of weeks working out alongside Fine. The two are often pictured on each other’s Instagram feeds, sprinting on a beach, holding planks and taking sweat-drenched water breaks together.

“Alex isn’t like other trainers,” Melton tells The Post. “He curates a workout regimen specifically around your needs. And he not only coaches you, but also works out with you.”

Melton and Fine also dieted together, taking on an intermittent fasting plan: They’d have their first meal of the day midafternoon, and it would typically be a light smoothie with salad and some protein, such as salmon.

“He worked out extremely hard for [his transformation] and was really dedicated,” Fine says of Melton, who has also been preparing for a role in the film “The Sun Is Also a Star.”

His diet recommendations come in handy for the “Riverdale” guys’ washboard abs. With Apa, Fine emphasized laying off the carbs and keeping to a low-calorie diet.

“[Apa] is pretty strict already,” Fine says, adding that he advised “no chips. No bread.”

It wasn’t always about losing weight, either: Fine also helped “Riverdale” actor Hart Denton through a visibly stunning transformation by gaining weight. Denton, who played Betty’s duplicitous brother Chic in previous episodes of the show, gained 22 pounds, mostly muscle, working with Fine. He thanked Fine on his Instagram for “showing me that fitness is a lifestyle, not something you just do when it’s convenient.”

“[Denton] worked out twice a day, and did boxing as well without me,” Fine says. “He was really consistent with it for a month, he gained a lot more muscle mass.”

Getting the “Riverdale” actors as strong as they are has become a hallmark of Fine’s career, he says, and a job he’s genuinely enjoyed: “It’s fun working with all of them. As a collective, they’re all extremely nice.”

“I’d imagine [the show] is doing so well because of how great each of them are as people,” Fine says.

Get Archie’s abs

To give “Archie” actor KJ Apa abs of steel, trainer Alex Fine prescribed a low-carb diet and lots of core and cardio moves. Do this circuit three times during your workout for a taste of the star’s daily grind.

Assault bike

Most gyms have this kind of stationary bike, also called an “air bike,” which has a fan in front rather than a wheel to generate resistance. To get your heart rate up in a flash, move the handles back and forth as quickly as you can while you pedal, bracing your core tightly, for one minute.

Twisted leg lifts

Hang from a pullup bar with your arms bent at a 90-degree angle. Brace your core and lift up your knees with a slight bend and angle them toward one shoulder, twisting your torso. Lower both knees to the front. Repeat up to 10 times on each side.

Kettlebell situps

Lie on your back holding a 10- to 15-pound kettlebell in one arm, straight above your shoulder. Engage your core and sit up, keeping your arm vertical the whole time. Lower back down with a straight arm. Do 10 reps with the weight in one arm, then 10 reps with the other arm.