EXCLUSIVE

One of the head writers for "Orange is the New Black" has filed for divorce ... the logical step since she's now realized she's a lesbian and is dating one of the female stars.

Lauren Morelli just filed divorce docs -- obtained by TMZ -- from her husband of 2 years, Steve Basilone. It's actually a joint petition ... probably because Steve realizes that ship has sailed.

The story is amazing. Lauren began writing for OITNB 5 months after she got hitched. Lauren says as she started writing for the main character -- who had once been in a lesbian relationship -- she saw herself in the character. Lauren says she began to feel like a fraud ... married to a man but clearly gay.

According to Lauren ... as she began writing about Piper's blossoming relationship with the very hot Alex ... "I found a mouthpiece for my own desires and a glimmer of what my future could look like."

Enter Samira Wiley -- who plays Poussey. It's Lauren's new GF.