word for when you realize you've said something stupid

Solution 1:

Chagrined, I believe, is what you're after. A hit of embarrasment, a bit of shame, and oh, that regret.

chagrin verb (be chagrined) Feel distressed or humiliated. ‘But he went on nationwide television and said that, and that he was chagrined by it and embarrassed by it.’ - ODO