Work, work, work and keep working.
In my case, a steady studio routine works best.
Sometimes it'll take days before anything really happens.
I have tons of bits and pieces of music I go through when I have no new idea that I can work on.
I also force myself to finish up stuff, or to do very specific things - like work out a certain type of change in tonality or mood.
Though this work is very technical and uninspired, it's all part of the bigger picture - it helps make me available when creativity hits.
Practice makes perfect, and creativity can also benefit from regular exercise. That's how you develop skills and learn your tools, which in turn make it easier for creativity to flow uninterrupted.
I see it as a sculptor, manipulating pieces of marble, evaluating them - he could be doing that for days until he finds one in which he sees something. That work may seems pointless, but it is far from fruitless.
And for me, personally - a dark, dimly lighted room, loose clothes and good cup of tea seem to help put me in the mood.