It is not illegal to be nude in San Francisco, in fact the city claims it is okay to be naked. Though a proposed law may mean that nudists will have to carry a towel to sit on.
On Saturday September 24 2011, nudists gathered at the top of the Castro District to protest and show people ‘nude is not lewd’. Approximately 20 to 30 people took part in the peaceful event.
**UPDATE: I have since been told it is no longer legal to be nude in public places.