A "vindictive" Melbourne nursing student claimed she was raped by a classmate, then manipulated her boyfriend into attacking the man, a judge says.

The victim was hit over the head with a bottle of chilli powder, kicked and imprisoned in the bathroom of his apartment for hours by the then-couple in December 2016.

Ge Zhang, 24, and Yuwei Xie, 25, who met at high school in China, avoided jail over the attack when they were sentenced to community-based orders in the County Court on Tuesday.

Judge Frances Hogan said the "convoluted" and "soap opera-like" saga began with nursing student Zhang having sex with a male classmate after a night of drinking.

That night Zhang had told her classmate that she had broken up with her personal trainer boyfriend Xie, but this was not true. She later told Xie that she had been raped.