James Harden literally went head over heels for Travis Scott's new music video ... teaming up to star in the Houston rapper's visuals for his hit single, "Way Back."

FYI -- the 5-time All Star and Travis are tight ... and were even seen turnin' up together after the Rockets were eliminated from the playoffs.

It's only fitting La Flame enlisted the Beard as the focus for the self-directed vid ... given the hook's lyrics, "James Harden with the range on me n***a way back."

Harden shows off that range by playing 1-on-1 with himself and hanging upside down midair while Travis plays video games in the background.

It's weird ... but in a good way.