“The Crown” star Vanessa Kirby is swapping British royalty for outer space after signing on for “StarDream,” the upcoming sci-fi movie from “The Wife” helmer Bjorn Runge.

Kirby takes the lead role of Andreya in the Silver Reel and Bigscope Films-produced picture, which follows the story of a spaceship hastily constructed to transport hundreds of thousands of cryogenically frozen humans from a failing planet Earth. When the on-board computer malfunctions, coder Andreya develops an artificial intelligence-based solution that she calls Stephen. But Stephen develops a profound attachment to Andreya, compromising the mission and the future of the human race.

Kirby landed a BAFTA for her portrayal of Princess Margaret in “The Crown.” She left the Netflix show after it welcomed a new cast for its latest seasons, appeared in “Mission: Impossible – Fallout” and has since signed on for Adam Leon’s untitled New York-set feature and Mona Fastvold’s “The World to Come.”

“To play the leading role in this intergalactic drama needs an extremely sensitive and thoughtful actress who can maintain the balance in her character: I have found that actress in Vanessa Kirby,” Runge said. “It is a tremendous honor for me to work together with her on this film.”

“StarDream” reunites Runge with several of the team from “The Wife,” which earned its star Glenn Close a Golden Globe, and an Oscar nomination. Silver Reel’s Claudia Bluemhuber will produce the film, Ulf Bråntas is director of photography, and Lena Runge is editor.

Production designer Suzie Davies (“Peterloo”) and visual effects producer Tim Field (“Bohemian Rhapsody”) have also joined the production team.

Bluemhuber is producing with Bigscope Films’ Jason Newmark and Laurie Cook, with co-producer Georgia Bayliff. Felix Harrison (“Far Edge of the World”) wrote the screenplay.

Kirby is represented by Hamilton Hodell in the U.K., and WME and Brillstein Entertainment Partners in the U.S.