The funny thing about musical inspiration is that it can very easily come from non-musical sources. Although maybe it's not that unusual after all. Maybe all music is just the audible expression of abstract emotions which can be triggered by external stimuli. And if that's the case, perhaps we can guide those emotions by controlling the stimuli.
In other words, sometimes looking at pretty pictures can help you make good music.
One really fun way to do this is to quite literally allow a piece of art - or anything you can look at, really - to dictate the pitch of the notes you play. For instance, the song "Weeping China Doll" from Steve Vai's new album The Story Of Light is based on the contour of flowers visible along the fence outside Vai's studio. That's a great way of spicing up your melodies, but if you don't happen to have an intrinsically musical garden there's something else you can do: take a pair of dice and roll them. Let one die represent a guitar string and the other a fret. Let them lead your fingers to strange melodic territory!
Here's another idea, and it's one that Pink Floyd were rumored to explore back in their early days: have someone draw an abstract image (the more freeform, the better), then agree on a key, and have the entire band improvise music according to the contours of the lines or shapes on the page. This is an especially good way of creating ambient, atmospheric soundscapes, but if you set up a very specific framework to operate within, you can use it for more conventional music as well. You can approach it literally (as Vai did with the flowers) by allowing the illustration to signify rises and falls in melody, or you can use it as a sort of 'texture map' to indicate when to use smooth, melodic tones and when to use fuzzier, grittier, angry ones.
These are both good ways of allowing something external to help guide your compositional experience, but they require a bit of interactivity to work. Sometimes I like to use more passive visual forms as inspiration. I have a Pinterest board called Visual Inspiration which I update from time to time with different images from various places on the web. You can check it out here if you like. If I'm in a particularly 'I'm out of ideas' mood I'll call up that board on my iPad or laptop and just focus on the image for a while as I play. There's a lot of quite colorful stuff there including:
A psychedelic Pan Am poster designed by pop artist Peter Max
A 1972 Olympics poster by Otl Aicher
The Fool by Pilgrim Lee (which happens to be hanging in my living room, but I like having it on my Visual Inspiration board too)
Cahill Expressway by Precisionist painter Jeffrey Smart
A poster of the Cartoon Network animation Adventure Time
A letterpress print of a San Francisco scene by lab partners
A beautiful photo of the Earth and moon, taken from the Galileo spacecraft as it departed for Jupiter in 1992.
A Soundgarden/Pearl Jam concert poster by Frank Kozic which I always liked.
Pinterest is interesting because it can have a social component if you wish to use it, or it can be quite personal if that's what you want to get out of it. Personally I don't really use the interactive side of it (except maybe to look at the occasional cute animal picture). Instead I just use it to chronicle things I come across online which I'd like to refer back to later.
Another thing I like to do for visual inspiration is switch on my lava lamp or my Mathmos Space Projector, which projects light through a rotating disc of different-colored oils. Both of these gizmos are good for getting into a meditative state of mind slightly dissociated from the intellectual side of playing music. Don't get me wrong, I'm all about the intellectual side, but sometimes it's nice to let myself focus my active attention on something visual while playing guitar, especially if I'm recording a song that I've practiced a lot and have developed good muscle memory for.
These are just a few ideas, of course. The beauty of using your eyes to inspire your music is that you can use whatever works for you: paintings, DVD menu screen loops, stock footage libraries, cartoons… anything that sets off an emotional, intellectual or musical response.