The piano playing in the film was performed by a professional pianist named Michael Bearden. He was a close friend of the film's director, Frank Darabont, and has also worked on other films like "The Shawshank Redemption" and "The Green Mile."
It's common for actors to use stand-ins or other performers for musical instruments in films, especially if the actor doesn't possess the necessary skills. This allows for a more authentic-sounding performance.