Here's a map of some quiet spaces to work in and nice things to do in Edinburgh when the festivals get a bit much. It's not comprehensive, I'm not an expert on Edinburgh or what you might need, but these are places and things I find help me and some people I know. I've focused on places walkable from the main festival spots (particularly for cafes), but everything in Edinburgh is pretty close and, y'know, buses.
Some other things I've found help - talk to normal people as much as possible about things other than the arts, eat proper food, get some sleep and if you're finding it tough, talk to someone about that. They're probably feeling the same.
Some other great advice here
Luck and love x