Blake Lively
Blake Lively was thrown a surprise birthday party and baby shower by her close friends. Pictured: Lively attends the "The Shallows" world premiere at AMC Loews Lincoln Square on June 21, 2016 in New York City. Getty Images/Dimitrios Kambouris

Blake Lively might not have much trouble looking effortlessly gorgeous 24/7, but even she had to make great sacrifices to achieve her flawless post-baby bikini body in "The Shallows" just months after welcoming her first child.

Ryan Reynold's wife, who is currently expecting her second child with the "Deadpool" star, recently dished on her secret to getting rock-hard abs and a toned figure just eight months after giving birth to their daughter James, 2. During an interview with "The Kyle & Jackie O Show," Lively confessed that she had to essentially live without any processed food and exercise relentlessly in order to get rid of all the baby weight.

"I did no gluten and no soy. Once you remove soy, you realize you're eating no processed foods. So that's basically what I did. No processed foods and then working out," she said on Tuesday, Aug. 16 (via US Weekly).

Lively explained that while it may sound easy in theory, it's actually very difficult to eliminate soy completely from one's diet because it's in virtually everything. "[It] seems like, 'Oh, that's really easy to cut that out,' but then you realize, there's soy in everything. Like, everything you eat, there is soy in it. Even if it's healthy, Whole Foods organic stuff, there's always soy in it. Just try no soy and no gluten and watch how hard that is," she shared.

Despite the diet restrictions, there were still some good foods that Lively could enjoy. "[I was ] able to have sugar and all of those things. You just have a balance of protein, carbs and vegetables. It wasn’t the worst. Like, I was eating rice and sushi," she said.

Still, she constantly found herself tempted to nibble on more indulgent foods like pastries. "That was the hardest part," Lively said of not being able to eat whatever she wanted. "They were making these fresh muffins every morning — those jacka--es. They smelled so good!"

Meanwhile, the "Gossip Girl" alum previously slammed the current obsession with the "post-baby body" during an interview with Sunrise, where she explained that women should not be held to impossible standards and be expected to look fit right after performing a "miracle."

"It's so unfair, it's so celebrated: 'This is what someone looks like after having a baby.' And I think a woman's body after having a baby is pretty amazing," she said. "You don't have to be Victoria's Secret-ready right away. You've just done this incredible miracle that life has to offer. You gave birth to a human being. I would really like to see that celebrated."