SPOILER WARNING: This article contains major spoilers for "The Bottle Episode," the midseason premiere of Supergirl.


Supergirl's Brainiac-5 just got a serious upgrade. In "The Bottle Episode," the midseason premiere, he removed his personality inhibitors and underwent a significant transformation, which turned his skin green and gave him his signature purple-and-black costume from the comics.

The episode picked up as the DEO discovered a wormhole that had allowed several doppelgangers to survive "Crisis on Infinite Earths," including several different versions of Brainy. When he was unable to keep up with his doppelgangers, he realized that was due to his personality inhibitors: the three glowing dots on his forehead. They urged him to take it off, but he refused because he was afraid that would unleash his inner darkness.

RELATED: Crisis on Infinite Earths Just Made Supergirl's Life Way More Complicated

"When I was eight years old, my family went on what humans might call a vacation. This is the first time I had seen the snow. It was incredible. My mother saw how much I loved it, how badly I wanted to stay there in the snow, and so she bottled it for me. The entire planet," Brainy later explained to Kara. "My father was horrified at what she had done. He freed the planet. I was so young and angry with him for taking away my planet. My planet. That anger terrified him. He feared that I, too, could hold such darkness within me. That I could become my mother. So he placed three personality inhibitors on me, the same ones I wear to this very day."

"When I wear them, I'm not fully calibrated with the Coluan network of minds, the Big Brain," he added, and told her that he feared what would happen if he took them off. "Because I might be worse. And Nia? She might not care for me."

RELATED: Supergirl Synopsis Promises a Major Legionnaire's Return

"Brainy, you are good to your core. You will never be your mother... because you're loved, and the people that love you will always fight for you," Kara assured him. Fortunately, he took those words to heart. When push came to shove and he had to fight one of his doppelgangers, he removed the inhibitors. This caused a dramatic change, from look to personality to pattern of speech. The costume, of course, is pulled directly out of the comics.

RELATED: Watchmen, Batwoman Earn GLAAD Award Nominations

Later, after the big fight, Brainy's doppelgangers decided to give up their corporeal forms to join the Big Brain. Before she went, his female doppelganger gave him a grave warning: "There's something you need to know. The reason I left the two of you to face today's threat alone is because I've been tracking Lex Luthor's every move. He's been calling the archive for information on only one thing: Leviathan. Leviathan is everywhere. The timeline of our worlds is closer than any other. Events progress on the same path. You must not make the same mistakes I made. I fought against Lex Luthor, and it led to catastrophe beyond imagining. It endangered the entire world."

"If you're going to save your world, you have to work with Lex Luthor," she continued. "I'll show you everything you need to know. I'll show you everything I did wrong in my world, how bad things became. But Querl, you must do this alone. No one can know that you're doing this. You must give up everyone and everything that you hold dear... till the world has been saved."

RELATED: Supergirl: Lex Luthor's Return Is the Best Thing to Happen to Season 5

Brainy took his doppelganger's advice very seriously -- so seriously, in fact, that he immediately broke up with Nia. Then, he went directly to Lex and offered to work with him to stop Leviathan. Lex welcomed him into the fold, setting their new partnership into motion. Brainy's first mission for Lex will be tracking down Winn Schott's doppelganger, who inherited his father's villainous predilections. They hope to use Winn's doppelganger to somehow gain knowledge from the future and get a leg up on the fight against Leviathan.

Airing Sundays at 9 p.m. ET/PT on The CW, Supergirl stars Melissa Benoist as Kara Danvers, David Harewood as Martian Manhunter and Chyler Leigh as Alex Danvers.

KEEP READING: Crisis On Infinite Earths: Every Single Cameo In The Arrowverse Crossover