The cupcake automat’s not likely to be confused with a bank ATM. (Courtesy of Sprinkles)

A drive-through or a to-go window? A magical app for smartphones that makes cupcakes appear on command?

The minds behind Sprinkles, which claims to have opened the world’s first cupcake bakery in Beverly Hills, has an answer: the automat.

Customers can walk up to the machine, which looks like a sherbet-colored ATM, select one of about eight daily popular flavors, swipe their credit card ($4 each) and receive an individually packaged cupcake.

The automat is the brainchild of founder and “Cupcake Wars” judge Candace Nelson.

“I conceived the idea of an automatic cupcake machine after having late-night sugar cravings while pregnant with my second son,” Nelson said. “Even as Sprinkles’ founder, I couldn’t get my midnight cupcake fix!”

The first machine will start humming in Beverly Hills within the next two weeks, says Nicole Schwartz, a Sprinkles’ marketing representative. She assures us that Sprinkles’ locations in the District and in New York are next on the dispenser list.

The facade of the Berverly Hills’ Sprinkles and the company’s new ice cream parlor that will open in mid-April. (Courtesy of Sprinkles)

In addition to helping to alleviate long lines during business hours, the machine is intended to make things easier for customers who have dogs in tow and therefore can’t come inside the shop, Schwartz says.

The inaugural automat will be situated between the bakery and the latest venture for the cupcake conglomerate: an ice cream shop that will serve fresh batches of the frozen dessert along with waffle cones and cupcake sandwiches; yes, that’s ice cream tucked between layers of Sprinkles cupcakes.

If all goes well, Schwartz says, Washington also could have its own taste of Sprinkles ice cream in the near future — although it won’t be available in ATM form.

View Photo Gallery: Try one of these recipes for a homemade treat.

If you’ve ever wondered what’s behind America’s current fascination with cupcakes, check out Andrea Adleman’s take, published last month in Food.

More cupcakes:

Cupcake automat? Yes, please.

A vegan queen’s cupcakes take the crown

All-American cupcakes, or how we got the shot

Cupcake taste test