Investors are understandably fascinated by the so-called "Magnificent Seven" stocks, a group of megacap companies that have created tremendous wealth for shareholders.

The Magnificent Seven are collectively worth $12 trillion -- nearly half of U.S. gross domestic product -- and they account for 27% of the S&P 500 (SNPINDEX: ^GSPC) by weighted exposure. The group includes: Apple, Microsoft, Alphabet, Amazon (AMZN 2.50%), Nvidia (NVDA 1.69%), Tesla, and Meta Platforms.

Six of the Magnificent Seven currently carry a consensus "buy" rating among Wall Street strategists, Tesla being the only exception with a "hold" rating.

But the highest price targets on Nvidia and Amazon imply greater upside than the highest price targets on other Magnificent Seven stocks, which arguably makes them the best investments of the bunch right now.

Here are the details.

Nvidia: 72% implied upside

CNN Business shows the highest 12-month price target on Nvidia as $767 per share, which implies 72% upside from its current price. I am a Nvidia shareholder, but I question whether the stock can add 72% in the next year. Shares have already soared 206% year to date, and they now trade at a valuation that borders on the absurd.

The investment thesis centers on artificial intelligence (AI), though all high-performance computing should be a tailwind for the company. Nvidia graphics processing units (GPUs) are the gold standard in rendering ultra-realistic graphics and accelerating demanding data center workloads like AI. In fact, the company holds more than 90% market share in workstation graphics and supercomputer accelerators, and Forrester Research says its GPUs are synonymous with AI infrastructure.

However, Nvidia is truly formidable because it pairs cutting-edge semiconductors with subscription software and cloud services.

The company's recently launched DGX Cloud is a supercomputing service that provides on-demand access to performance infrastructure, pretrained models, and powerful AI software. Those tools help enterprises build AI applications that address use cases ranging from retail and financial services to autonomous robotics and self-driving cars.

Let me be clear: Nvidia is an extraordinary company that will undoubtedly benefit as industries like AI, robotics, and gaming continue to evolve. But even the best company at too high a price is a bad investment, and Nvidia's valuation has drifted into uncharted territory. Shares currently trade at about 43 times sales, an outrageous premium to the five-year average of 18.5 times sales. In fact, Nvidia stock has never been this expensive at any point in history.

For that reason, I think investors should avoid buying this stock for the time being. I have no plans to sell my entire stake in Nvidia, but now is a good time to trim overly large positions.

Amazon: 58% implied upside

CNN Business shows the highest 12-month price target on Amazon as $220 per share, which implies 58% upside from its current price. Investors should never lean too heavily on the opinion of any single analyst, but Amazon stock does indeed look cheap at its current valuation.

The investment thesis boils down to growth opportunities in e-commerce, digital advertising, and cloud computing, three areas where Amazon enjoys a strong competitive position.

Amazon's online marketplace receives nearly four times more visitors than the next closest digital-shopping destination, and it will account for roughly 39% of online retail sales in North America and Western Europe this year, according to eMarketer.

Amazon has turned its clout in e-commerce into a blossoming ad-tech business. Its ability to engage shoppers and collect consumer data makes it an ideal advertising partner for brands. Indeed, Amazon has become the third-largest digital advertiser in the world, and the company is gaining ground on the industry leaders Alphabet and Meta Platforms.

Additionally, Amazon Web Services (AWS) is the leader across a wide range of cloud-computing categories that include "compute, networking, storage, database, data solutions, and machine learning," according to CEO Andy Jassy.

Indeed, AWS accounted for 32% of cloud-infrastructure and platform-services revenue in the second quarter, which is roughly as much market share as Microsoft Azure and Alphabet's Google Cloud captured together.

Here's why all that matters: Retail e-commerce sales are expected to grow at an annualized 13.6% through 2030, while ad-tech sales and cloud-computing spend are forecast to grow at an annualized 13.7% and 14.1%, respectively, during the same period. That gives Amazon a great shot at double-digit revenue growth through the end of the decade.

Yet, shares currently trade at 2.7 times sales, a nice discount to the five-year average of 3.5 times sales. That makes this growth stock a screaming buy, though Amazon is best viewed as a long-term investment. There is no guarantee the stock will produce a positive return in the next year.