James McAvoy in early talks for ‘Trance’

Danny Boyle thriller being distributed by Fox Searchlight

James McAvoy is in early discussions for a role in Fox Searchlight’s “Trance,” Danny Boyle’s first film since “127 Hours.”

Boyle will helm the heist thriller before directing the 2012 London Olympics. He’s also producing with Christian Colson.

Pic is loosely based on Joe Ahearne’s British TV movie about an employee at an auction house who teams with thieves to steal a valuable painting. But he suffers amnesia from a blow to the head and can’t remember where the painting is hidden.

McAvoy’s “X-Men: First Class” co-star Michael Fassbender’s name had been tossed around for another role in May, but he’s apparently out of the picture.

“Trance” is yet another left turn from Boyle’s already eclectic oeuvre, including “28 Days Later,” “Slumdog Millionaire” and “The Beach.”

Pic has no firm release date but will likely unspool in 2013.

McAvoy is repped by UTA and Ruth Young at United Agents in London.