Actress Kerry Washington struggled with sleepless nights while portraying a slave in new movie Django Unchained because it pained her to imagine the suffering her ancestors once endured.

The Ray star plays Jamie Foxx's wife Broomhilda Von Shaft in the upcoming Western, which was filmed in America's Deep South, and she reveals the nine-month shoot was emotionally tasking because it forced her to relive the everyday horrors her distant relatives experienced at the hands of their owners.

She tells U.S. Tv host Oprah Winfrey, "We were privileged to shoot on an actual slave plantation in Louisiana and... there was a day that I had to do a scene where my character is whipped for attempting to run away. And one... of the production assistants said to one of the people who works at the plantation, 'Well, how come that tree doesn't have any moss?' And the expert at the plantation said, 'That was probably a hanging tree.' And that tree was above the scene where I was being whipped, so I knew that where my character was withstanding these lashes, that someone had died there.

"I mean Jamie and I almost didn't survive the shooting of the movie for pretend. I mean we were texting each other at three or four in the morning: 'I can't sleep, I can't believe what we have to do tomorrow, I can't believe what we have to go through.' And the fact that I could barely make it through the nine months, I'm so grateful that there were people who came before me who were able live through it for their whole lifetime."

And the 35 year old credits her co-star with helping her get through the project: "I could not have done Django (Unchained) without Jamie because this character required me to go to places that were unimaginable and it really pushed me to the edge of my sanity, to be quite frank."