May I suggest what is probably the obvious here... that perhaps this is something it would be worthwhile talking through, at-length & in-depth, with a skilled mental health therapist? There's certainly nothing wrong with being attracted to members of the same sex. The problems here involve the impact this might have on your marriage were your husband to become aware of it & what the distress you're experiencing may be doing to you emotionally.
Left unaddressed, something like this has a way of eating at your insides. And it may be unlikely it's going to simply disappear on its own. Bringing it out into the open, within the therapeutic process, may help you to figure out what this means for you & what, if anything you want to do about it.
I myself have had a life-long struggle with gender identity dysphoria. And my GID has eaten at me the way what you're experiencing is eating at you. For a variety of reasons, I don't see a therapist. I did for a short time a few years ago. And while I did, it was a major (if brief) relief. Were my circumstances different, I would love to do it again.