the source that it is forbidden to think about other people during relations is from the gemorah
and even what the woman thinks is a problem
but also in the gemara it also says https://www.sefaria.org/Berakhot.20a.7?lang=bi
Similarly, the Gemara relates that Rabbi Yoḥanan was accustomed to go and sit at the gates of the women’s immersion sites. Rabbi Yoḥanan, who was known for his extraordinary good looks, explained this and said: When the daughters of Israel emerge from their immersion, they will look at me, and will have children as beautiful as I.
from the above and other places we see that what the woman thinks about during relations affects the child
and it seems to me that what is forbidden is to think that you are having relations with someone you are not having relations with now, (for woman it seems to only happen if she had relations with someone else, in the past)
but if you are not thinking you are having relations with someone else but only how they look it seems not to be a problem at all (the opposite this effect should be used to make good children)
PS it seems to be a very popular Minhag in Chabad to imagine the Rebbe (i guess it is because he is considered beautiful and ... so it will have a good effect), based on what I heard from many hasanim in the habad kollel in crown heights.