Here's a summary (from David Huron) of Freud's account of art as sublimation:
The major tenets of Freud's theory can be summarized as follows:
1. There exists an unconscious mental life that remains largely hidden from our conscious awareness.
2. The unconscious manifests desires and instincts that may be in conflict with social norms of behavior -- norms that may be accepted at a conscious level.
3. The unconscious nevertheless affects our conscious thoughts and actions. Even when we think we are being our most logical, controlled, rational, and dispassionate self, unconscious motives and instincts continue to underlie our thoughts and actions. Our biological origins and animal desires are not far from the surface of thought.
4. Mental conflict between the conscious and unconscious is both a part of pathology and a normal part of human development.
5. Mental conflict arises when instinctual tendencies are either excluded from consciousness and action (repression), or are modified (sublimation).
6. Repression can or will lead to phobias, inhibitions, obsessions, or neuroses. For example, sexual repression for a celibate priest might lead to depression. Dreams and mistakes (slips of the tongue) are examples of how these occur in everyday life.
7. Sublimation is the process by which mental conflicts are transformed into positive expressions. For example, sexual conflict may lead to artistic expressions.
8. Accordingly, the engine of artistic creativity is the psychic conflict of the artist. The difference between the artist and the mental patient is that the artist has succeeded in sublimating what the mental patient has repressed.