If they're already bound to these keys, as your post suggests, then there is no need to bind them again. If not... read on.
You can bind selecting these potions in inventory to a key, but not via the in-game menus. Instead, you have to edit the appropriate .bnd file yourself. I recommend saving your current key configuration via the game first, e.g., as "potions" (or whatever name you like). Then, look into the folder saves in your game folder. There should be several files there like cfg0000.bnd, cfg0001.bnd, etc.. The newest one contains the key configuration you just saved.
Open that .bnd file with a text editor, e.g., Notepad, Notepad++, ... Don't use word processors like Wordpad, Office/Word, LibreOffice etc., for they will usually save in their special format not recognized by the game.
Look for a line like
Code:
bind f3 "inv_select invisipotion"
and change the "f3" to "f9" to bind selecting the Invisibility potion to F9. Then, look for another line beginning with
and put a semicolon (";") before it. That disables this line without completely deleting it.
Likewise, change
Code:
bind f5 "inv_select speedpotion"
to
Code:
bind f8 "inv_select speedpotion"
and find another line beginning with
where you also have to put a semicolon before the line to disable it.
This should have changed the key assignments for the two potions while un-binding the former assignments for F8 and F9.