7 hour layover is almost not enough at SFO. SFO to San Francisco on a bad day of traffic can take over an hour+. If you go, I suggest using BART or something similar as it will be easier than a cab/uber. Train takes about 40 min and is like $9 each way.
I would budget at least an hour out and two hours back to give you enough time to get the train, travel, get your bags, and go back through security. Leaves you about 3-4 hours in San Francisco.
What are you hoping to see?