I don't know that it's entirely possible to stay sane while dieting, but here's a few tricks that may work.
1. First and foremost: when you're hurting focus on your goals. Remember why you undertook this crazy challenge in the first place and what it means to you. This is my most effective means of staying disciplined while on the diet.
2. Cheat meals! These should be planned and normally no more than once per week early in the diet and then used only when needed to stave off catabolism in the final weeks. These not only prevent the body from breaking down too much, but also help the mind. The mental break can be very valuable and reduce stress levels. The most important part of these is to totally indulge what ever cravings you have. That is the entire point of the meal. However, it must be one single meal. This means all of the food should be eaten within approximately a 45 minute window. It also must be the last meal of the day, and if it can be the post training meal, that's even better. So, if you want a whole large pizza and ice cream - go for it!
3. If you have a sweet tooth, sugar-free Jell-O can be a savior. It tastes great and provides no calories so it can be a guilt-free pleasure when needed.