DESIREE Akhavan has been to Edinburgh before. She last came to the city in 2015. “I fell in love with a woman here and I ran to her,” the Iranian-American actress explains.

It was November when she arrived. She lived in the city until March the following year. The weather was terrible. The city dripped with rain. It felt like the world was in mourning. But that didn’t matter. Love was enough. And then the woman broke her heart. She hasn’t been back since. Until now.

August 2018. Desiree Akhavan walks into Edinburgh’s G&V Hotel, wearing black dress and heels. Quite the entrance. It is her first time back in the city since that winter. “It’s hard coming back,” she says, sipping a glass of Merlot in the hotel bar, “because I wanted to be Scottish. I wanted to be with that girl. I loved being here.”

It’s work that has brought her back today. She’s in town to attend a Channel 4 dinner in support of her upcoming TV drama The Bisexual, a title that is a summary both of the subject matter and Akhavan’s life experience.

Akhavan, who lives in London and grew up in New York after her parents fled from Iran following the revolution in 1979, made her name with her smart, sharp, explicit comic film Appropriate Behaviour about an Iranian American woman hiding her sexuality from her parents and rediscovering the pleasures and pains of sex outwith a long-term relationship. (Everyone who has seen it will mention the awkwardly humorous threesome sequence.)

Sexuality apart, her other new project may seem distant from her own life. This week sees the release of her new movie, The Miseducation Of Cameron Post, in which she directs Chloe Grace Moretz playing a young girl who is sent to a gay conversion therapy centre after being caught making out with one of her friends.

But as we talk it is quickly apparent that Akhavan can find all sorts of echoes of her own experience within the fictional world of the movie. In conversation, she threads her own story into the world of the film. For her, work and life are a reflecting hall of mirrors.

She’s less interested today in talking about how immoral and ridiculous gay conversion therapy is (although she’s on side with that). Rather, she sees it as a metaphor for the experience of feeling an outsider for any reason.

“When you become a teenager you’re diseased. Whatever your Achilles’ heel is – even if it’s not being homosexual; say, it’s being overweight or too tall, too short, too this, too that … Every teenager has something they’re too much of and they wish they could exorcise themselves of it.”

Too many spots, in my case, I tell her. “I was twice on Accutane,” she says, “a drug where the side-effect is suicide.” She’s being flippant here, but the NHS warn the drug has been linked to suicidal thoughts in rare cases.

That’s a good measure of her humour. Dark and on the edge. It’s all over The Miseducation Of Cameron Post, which won the grand jury prize at the Sundance film festival in January. Adapted from Emily M Danforth’s novel, it has fun with religion, karaoke and sexual repression. Akhavan both directed it and wrote the screenplay with her writing partner Cecilia Frugiuele. (Akhavan was working on the last rewrites during her time in Edinburgh.)

She wanted to make it, she says, because she loved the tone of the book, the way it found humour in the face of tragedy. “It felt honest,” she says. “I loved the way sex was depicted. To me it felt like a John Hughes film.

“It’s funny being a teenager. It’s the same bulls*** no matter where in the world you are. Unless you’re from a war-torn country … Which most of my family was.”

What was Akhavan like as a teenager? “Invisible,” she says to begin with. “Totally invisible.”

But then she changes tack. “It’s tricky because I was also quite visible for being very ugly. I was voted the ugliest person at my school. I’m very lucky that I grew into myself. I think when you grow up being told you’re ugly every year it’s a gift. I was bigger than I am now, which was hard. The world didn’t feel built for me. My nickname was ‘the beast’. I was visible in that way.

“And yet when it came to a conversation or sharing information I was never the person invited in. So I watched a lot. I didn’t have many friends. I leaned on movies and television.”

This is all difficult to square with the striking woman sitting in front of me, I tell her.

“I have had a nose job. Full disclosure. As a teenager my parents kind of pushed me into it. It’s an Iranian rite of passage and for better or worse my face looks a little different.

“I’m still a big girl. I’m a size 12, but I really like myself and I think it’s clear I know how to carry myself and I can let go of the discomfort I have.

“I gave myself a job where I’m often in front of the camera and you just get to say: ‘Let’s pretend I’m Heidi Klum or whatever.’ Or: ‘Let’s pretend I’m the smartest person in the room. Let’s pretend I’m Zadie Smith.’ You may not feel that way, but I get to pretend for a living.”

One of the impressive things about her film is that though the adults are in the wrong, there are no pantomime villains here. “Good. I’m glad you think that. There shouldn’t be.”

We’re all human, I say.

“Unless you’re Donald Trump … Yeah, with the exception of the American White House administration, every person I meet – even people who do the most horrific things – all have an incredible inner monologue that’s driving them there.

“I really wanted to make a film that is true to abuse as I knew it because abuse as I knew it was always at the hands of people who loved me and had the best intentions for me.

“And when I watched abuse on film and television it felt very black and white, very heavy-handed, very like: ‘Dad threw little Tommy down the stairs when he was drunk. He’s an alcoholic. He’s just a bad guy. It’s the alcohol talking.”

Sorry, can we backtrack a moment? Abuse as you knew it?

“I’m not ready to speak about it publicly. Thank you for asking. I allude to it because I think everyone defines for themselves what abuse is. I definitely had many episodes growing up and I spent my 20s shedding the weight of that. But most people have. I don’t think I’m a unicorn in that. I think that all experiences of life include abuse.”

What she will talk about is the fact that at 25, Akhavan went to a rehabilitation centre to deal with bulimia.

“For years I was struggling on my own. I was in graduate school at the time so I used their facilities, their nutritionist and their weekly group therapy for years, but I wasn’t getting better. I was just getting worse.

“I had hit a point where I thought I may not become a film maker. I kept thinking: ‘As soon as I am comfortable in my career then I’ll focus on getting better.’ But then finally I hit a point where in my crazy head I honestly genuinely thought: ‘I’d rather die than be fat. I’d rather be dead.And I know that’s crazy so I need to let other people take care of me for a while.’

“You hit this point specifically with eating disorders where you can’t even tell when you’re hungry or you’re full or anything. That’s when I went to an outpatients centre in Manhattan.”

She spent a week in care then the next year as an outpatient. “It completely changed my life for the better. Knock wood, no relapses.”

For a while, she wondered if her dysfunctional relationship with food was just as much a part of her as her sexuality. “What’s odd is as soon as I left there I fell in love with a woman and I came out to my family. I think it’s a lot about repression and secrets.”

You actually link your bulimia to fear of coming out? “I’d say it was a part of it. I think any kind of compulsive behaviour that you know is bad for you comes down to your relationship to your body, your relationship to sex, your relationship to your shame. And I felt shame for a lot of reasons and my sexuality was definitely one of them.

“It was being able to be fully honest with my family about something that was such a big part of myself, this secret I had been hiding …”

And when you’ve told your family, you’re just hoping they accept it, I guess.

“Yeah and for a few years it felt like they weren’t. I feel really blessed to know unconditional love. I don’t think anyone knows it unless they’ve tested it and my family was not raised to want a child like me and now they’re so proud and so supportive but they had to question all of their beliefs and their morals.”

Maybe this is a good time to talk about sex. Or at least sex on the screen. One of the things about Akhavan’s work is the way she uses sex to reveal character. I wonder how she goes about shooting these scenes. How do you be honest to the emotions involved while protecting the actors too?

“I’m very confident shooting sex scenes. I love doing it. I’ve been in many. I don’t love being in them as much as I love directing them, but I love them because I think they’re an opportunity to communicate something about that character that you could never communicate with dialogue.

“And I love making decisions about how people have sex and what happens over the course of a sex scene. That to me is meaty and I know as an actor can bite their teeth into that.

“This is the first time I was shooting sex scenes that I wasn’t in and it was fantastic because I wasn’t having to worry about my own body. When I’m in them I usually choreograph it down to the breath. I do little stick figure drawings for everybody and we all know what’s going on. It’s a dance between yourself the cinematographer and the other actor.”

Shooting the scene with Grace Moretz’s character and her friend Coley, played by Quinn Shephard, making out in the car, Akhavan says, gave her goosebumps.

“I remember thinking: ‘I’m taking a risk on her. Let’s see what she brings to the table,” she says of Moretz. “And she brought it. She completely sold it and so did Quinn. And it was the first time at the monitor that I kind of understood what directing was. I had chills even thinking about it. I have chills right now. It was just magic.

“My ex-girlfriend was there, who was the person who said you should make the film in the first place, and we just looked at each other and we were like: ‘We did it.’”

Grace Moretz is fantastic in the film, it should be said. It was a chance for her to express herself, Akhavan says. “After doing so many studio films – what is it – like 60 films since she was five years old? – she’s been in a lot of rooms with men primarily telling her how to move, how to moan, how to arch her back. I didn’t want to tell her that. I wanted to see what she did.”

What are we looking at in those scenes? Desire, yes. But not flesh. On her Twitter feed I’d noticed that Akhavan had complained about the lesbian sex scenes in the film Blue Is The Warmest Colour. The male gaze writ large, you might say.

“And you’re entitled to your gaze. I just think when it’s a marginalised story, a story you never see on the screen ...”

Suddenly she jumps tracks again. “It makes me think of representations of trans actors on screen. Trans people, at least in America, can’t even use the f***ing toilet. They are so vilified. Their lives are under attack. Trans women of colour are killed at skyrocketing rates. To then say: ‘Let’s get Scarlett Johansson to play you in your story is absolute absurdity.”

She returns to her original point. “Yeah, to put the male gaze onto something as delicate as female sexuality, female desire, lesbian desire – it really left a mark on me.

“I’d like to think these sex scenes are subjective. That Blue Is The Warmest Colour scene is really objective. It’s really saying, how do lesbians have sex? Let me show you. A very clinical view of lesbians having sex. In this I want you to be Cameron, I want you to lose yourself and imagine what it is like to lust for someone.

“And what’s interesting is, Blue Is The Warmest Colour is so subjective when it comes to appetite; the close-ups of her mouth when she’s eating, how she desires this other girl. It does such a good job of showing her desire and such a bad job of showing her f***ing.”

That’s the French male gaze of course. Rebarbative bad taste sex comedies aside, sometimes it feels like sex has disappeared from both American and British cinema. Are we still puritans at heart?

“Americans are. I think it’s different in the UK. That’s why I do well here. Not ‘do well’ – I pay my rent. That was always the goal. After I made my first movie I couldn’t find work. I couldn’t find work on my own terms to be fair. I wanted to direct something that represented me. ‘Do you want to direct this horrible studio vehicle for some hot blonde girl? Another version of something you’ve already seen?’ No, I don’t want to go and be a cog in your wheel. I have things I need to say.”

Everyone deserves to tell their story, Desiree Akhavan says, “but I deserve it too”.

No-one will tell it better.

The Miseducation Of Cameron Post is in cinemas from Friday