Negative Friends

I’ve noticed that most of my friends have lots of negative thoughts which lead to negative conversations. Now that I’ve become aware of this and I’m working on changing my own negative thoughts, I don’t like adding fuel to the fire when I hang out with them. My solution has been to remain silent but it feels awkward. Any suggestions on how to engage here?