If you are wanting to try a different melody for a tune, it is no different from creating a melody the first time. Let us assume that you will keep the lyrics pretty much the same. You have two polar approaches:
Use the harmony, the chord progression, to shape the melody. You can use the existing progression or create a new one.
Create the new melody and re-harmonize later
In fact, it will probably be a combined strategy.
You can change the notes, the pitch and duration.
You can add or remove rests.
You can change which notes get a beat.
You can change the meter.
You can surely change things in ways I have not thought of
When using UDIO.COM to re-envision my lyrics, I saw some entirely unexpected revisions to my tunes, to the melodies themselves. They opened my mind to new possibilities for old songs.
Of course, you do not have to use your own lyrics. You can borrow those of someone else. For instance, take a folk tune as I did with UDIO.COM and “The Water is Wide.” I had the AI produce a bluegrass version. It could not use the original melody, since I gave it only lyrics. It substantially changed the phrasing, the rhythm of the tune.
As long as you are respecting copywright, you can work with any text. You might try some poetry for instance, or maybe songs that have lyrics which resonate with you. You may not even know the song. Songbooks are full of tunes I don’t remember hearing. If you are just playing for your own benefit, copyright does not seem to be an issue.
I have no problem coming up with melodies in large numbers. The deeper problem is coming up with great melodies. I am still working on that part.
For examples, see: