2007–2010: Romantic comedies
Alba reprised her role in Fantastic Four: Rise of the Silver Surfer, released in June 2007. According to Alba, Tim Story's direction during an emotional scene almost made her quit acting. "[He told me] 'It looks too real. It looks too painful. Can you be prettier when you cry? Cry pretty, Jessica.' He was like, 'Don't do that thing with your face. Just make it flat. We can CGI the tears in." According to Alba, this experience filled her with self-doubt: "And then it all got me thinking: Am I not good enough? Are my instincts and my emotions not good enough? Do people hate them so much that they don't want me to be a person? Am I not allowed to be a person in my work? And so I just said, 'Fuck it. I don't care about this business anymore.'" The film grossed US$290 million globally.
In Good Luck Chuck (also 2007), Alba portrayed the love interest of a womanizer dentist. She posed for one of the Good Luck Chuck's theatrical posters parodying the well-known Rolling Stone cover photographed by Annie Leibovitz featuring John Lennon and Yoko Ono in similar poses. While the film was heavily panned by critics, it made almost US$60 million upon its release. Her third starring vehicle in 2007 was the psychological thriller Awake, portraying the girlfriend of a wealthy man who is about to have a heart transplant. Reviews were lukewarm, but Roger Ebert praised her performance, and budgeted at around US$8 million, the film made US$32.7 million.
In February 2008, she hosted the Academy of Motion Picture Arts and Sciences' Science and Technical Awards. Alba made her acting transition to the horror genre in the film The Eye, a remake of the Hong Kong original, in which she obtained the role of a successful classical violinist who receives an eye transplant that allows her to see into the supernatural world. Though the film was not well received by critics, her performance itself received mixed reviews. She garnered a Teen Choice for Choice Movie Actress: Horror–Thriller and a Razzie Award nomination for Worst Actress (shared with The Love Guru). In 2008, she also played a salesgirl in the independent romantic comedy Meet Bill, alongside Logan Lerman and Elizabeth Banks, and starred in the comedy The Love Guru, as a woman who inherits the Toronto Maple Leafs hockey team, opposite Mike Myers and Justin Timberlake. Mick LaSalle, of the San Francisco Chronicle, noting that she was "prominently" in the film, felt that she "finally seems relaxed on camera". The Love Guru was a critical and commercial flop.
While Alba did not have any film releases in 2009, five high-profile films released throughout 2010 featured her in significant roles. Her first role in the year was that of a prostitute in The Killer Inside Me, an adaptation of the book of the same name, opposite Kate Hudson and Casey Affleck, which premiered at the Sundance Film Festival to polarized reactions from critics. Her next film was the romantic comedy Valentine's Day, in which she played the girlfriend of a florist as part of a long ensemble cast consisting of Jessica Biel, Bradley Cooper, Taylor Lautner and Julia Roberts, among others. Despite negative reviews, the film was a commercial success, with a worldwide gross of US$216.5 million. In the action film Machete, Alba reunited with director Robert Rodriguez, taking on the role of an immigration officer torn between enforcing the law and doing what is popular in the eyes of her family. Machete made over US$44 million globally.
The drama An Invisible Sign of My Own, which Alba filmed in late 2008, premiered at the Hamptons Film Festival. In it, she portrayed a painfully withdrawn young woman. Her last 2010 film was the comedy Little Fockers, in which she played an extrovert drug representative, reuniting with Robert De Niro, who was also in Machete. Despite negative reviews from critics, the film grossed over US$310 million worldwide. For all her 2010 roles, she received a Razzie Award for Worst Supporting Actress.