First off I think that the question you really want to ask is how to approach improvisation. To improvise you really need to know music, the structure of songs, melodies and how they are built, some music theory. You also need to spend time exploring your own unique musical style. A lot of new musicians interested in learning improv, especially jazz, start with play along CDs or computer versions of the same. These products come with lead sheets and instructions that tell the student to play a mode over each chord, one that matches. Without experience this always leads to meaningless meandering up and down scale exercises for solos. This is NOT improv.
Improv is almost always described as variation on a theme. If it's a solo over a standard then learn the song and use its melodies as inspiration. If you are composing then try composing first so you have a basic idea to play with.
A better approach is to start writing your own licks, short one phrase melodies that you like, that sound like something you would want to hear. Then practice using these licks when you solo. This will lead to meaningful expressive solos. So I think you have the process reversed. Instead of improvising for a while then trying to compose something from it, try composing for a while then try modifying it on the fly. There is a great book by Jerry Coker (Improvising Jazz) that describes this process that I think is a much better approach to authentic improv than most. Improv generally has more emotion in it than rehearsed compositions. I hope that helps.