There are a lot of studies that show explicitly that the most creative moments of your days are when you are right between sleeping and waking. I mentioned this in another thread just the other day, it's called Hypnagogia.
Some of those you mention actively understood this. Einstein, when he needed to solve a serious issue, performed his "Deep Thought Experiment", which consisted of him sitting on a chair with a large rock in his hands, thinking about the problem while trying to doze off. When he hit the point just about falling asleep, the rock dropped from his hands, and he awoke, often with a solution clear in his mind.
I have no doubt that taking walks is imperative to the process though! I couldn't live without my forest next door.