Lena Dunham is opening about her relationship with food as she shares an exclusive food diary with Elle UK.

While in England to research a new film, Dunham gets candid about the heartbreak she endured following the end of her six-year relationship with musician Jack Antonoff.

“Sadness is the only thing that’s ever made me lose weight,” the actress says, describing how she felt after splitting with Antonoff. “Two years ago, during the last gasps of my six-year relationship, I lost weight. Not a little weight. Not the kind of weight where your bras feel kind of generous and you marvel at your subtle but oh-wow-it’s-definitely-there-now clavicle. No, it was a lot of weight.”

RELATED: Lena Dunham Reveals She Checked Herself Into Therapy When She Was ‘Sick, Skinny And Addicted To Pills’

“It happened, like many things, at first slowly and then all at once. It started with a stomach infection that necessitated a diet of basmati rice and bottles of Pedialyte (didn’t hate it). Then came the 2016 election, when we all either started or stopped eating en masse,” Dunham says.

The “Once Upon A Time In Hollywood” actress keeps track of her eating in a food diary to make her “accountable” for what she consumes.

“If I write down what I eat, I’ll have to hold myself accountable and accountable people don’t gain 30 pounds in a single month,” says Dunham. “Yes, I am body positive but I am also a young single woman working in Hollywood and I can’t just pretend that weight is not a thing. It’s a thing.”

However, Dunham, 33, says she didn’t feel elated by her smaller figure.

RELATED: Lena Dunham On Her Decision To Move Out Of The Apartment She Shared With Ex Jack Antonoff: ‘Someone Had to Go’

“At the end of that relationship, the weight was falling off in double digits but, as I explained to my closest friends, I experienced none of the heady triumph of the women showing off their formerly-huge jeans in a full-page ad for weight-loss pills,” she explains, adding that she moved on quickly following their split. “When my boyfriend and I broke up, I very quickly took a lover. He was someone I had known from childhood and he was, in many ways, exactly as I remembered him: goofy and physical, boyish and sweet. I went from being touched barely at all to being the very definition of touch.”

Part of her heartbreak recovery also involved getting sober. The actress did a stint in rehab and celebrated her one-year of sobriety in April of 2019.

“I had also completed in-patient treatment, known to the public as rehab for trauma and prescription drug dependency or, as I like to call it, a five-star hotel where they take away your razors,” she jokes with the magazine. “It took a week, but as the drugs left my body and I made peace with the fact that I was here to heal, not just to cut my own bangs and weep (just kidding: you can’t cut your own bangs because they won’t give you scissors). I got real hungry, real fast. If it wasn’t nailed down, I ate it.”

Dunham’s interview is in the November issue of Elle UK, on sale Oct. 3.