Other ideas that might help:
For all of the different types of chords that you know how to play, try out each of the twelve possible harmonic intervals that you can play above the root of that chord type, and understand the kind of sensations and emotions that each sound evokes.
Once you discover that you love the sounds of particular harmonic intervals played above a particular chord type, these have to become part of your vocabulary. These are the pitches that you will want to be able to grab and hold as you invent melodies. For myself, I especially love the sound of perfect 4ths held above minor chords and the sound of augmented 4ths above major chords.
You should practice how to approach and how to oscillate around these pitches melodically using both chromatic and diatonic motions.
For a chromatic approach, start a phrase a certain distance above or below a goal pitch and move by a sequence of half steps until the goal is reached and then hold the goal pitch for longer. For a chromatic oscillation, start on a chord or scale pitch and move a half step away up or down, move back to the start, then move by half step in the opposite direction and move back to home. You can also leave out the middle visit to the home pitch and jump from one side of home to the other before returning.
For a diatonic approach, move towards a goal pitch playing all of the scale tones from a starting point above or below until the goal is reached. For a diatonic oscillation move from a chord or scale tone to its nearest scale neighbors before returning to your starting pitch.
You should try to categorize for yourself if a particular interval played above a chord creates a tense or relaxing sensation. If an interval releases tension, it will be natural to use it as a resting or stopping place in your lines. If it increases tension, you'll feel as though it's dangerous to hold that pitch and you'll want to move quickly to another interval.
Thinking in these terms, you'll notice that certain pitches in the context of a particular chord type are seemingly magnetically attracted to other intervals. If you hear one type of interval, it will really satisfying to hear it followed by another particular interval. You'll also notice that pitches in one chord will be attracted to entirely different pitches as chords change in the accompaniment.
You should build a vocabulary of move sequences between two, three and four harmonic intervals that sound good within the span of a particular chord and then other sequences that sound good as you move across chord boundaries.
For any harmonic interval you choose to create, you'll want to know several other intervals that you can move to leave that sound.
When you move from one pitch to another, a characteristic melodic interval will be formed. You should know the sensations and emotional connotations of each of the different melodic intervals that you can produce. It's the combination of change of harmonic interval and simultaneous change of melodic interval that determines the meaning of each note that you play in a melody.
When you find a pitch that works over a particular chord in a chord progression, it helps to know what the lifetime of that pitch is as the progression is followed. If you hold a pitch as the accompanying chords change, each chord change will create a different harmonic interval between the chord root and the held pitch.
Your ear will tell you that once a particular successor chord arrives, it's not tenable to hold a particular pitch any longer. Any pitch that you hold will nearly always run into a musical wall if you hold it long enough, and you will need to know which pitches will sound good in the new chord change and move to one of those as you continue your line.
Rhythmically, you should eventually know what it feels like to start your line at any subdivision of a measure. You should know what it feels like to start a phrase on any of the beats within a measure. You should know what it feels like to subdivide each beat by 2,3,4,5,6,7 and 8, and to start playing at any of those beat subdivisions. Being able to vary the starting points of the phrases that you invent adds interest to a performance.
Melodic phrases in music typically move quickly at the start, hold a steady speed and then slow down or pause for longer duration to mark their end. You should study different ways to put a line in motion and different ways to stop or pause within it.
It's interesting to experiment with successions of different sized phrases. Accomplished improvisors know how to balance long phrases with shorter phrases. Many times the phrase successions of good improvisor will sound conversational because of the variety and balance of phrase lengths that they use.
It's interesting to experiment with the amount of space that you leave between phrases. Great improvisors have their own suprising ways to stop or pause as they play.