Although both the attitudes of the colonial powers and the attitudes of the natives mattered, I would say that the colonial powers were more important in determining whether decolonization would be peaceful in any given colony. My main piece of evidence for this is the fact that some colonial powers had many violent decolonizations while other powers did had few or none.
My main examples of colonial powers are France and England. These are the best examples since they each had many colonies and because their experiences with decolonization were very different. France had colonies in Asia and Africa. In both areas, there were examples of colonial wars. The most violent of these wars were the wars in Vietnam and in Algeria. By contrast, Britain did not have even one decolonization experience that was as violent as either of these wars.
It is possible that France simply had bad luck with violent natives. However, this seems unlikely. It is unlikely that any native group would have preferred to fight if it could get what it wanted without fighting. The difference, in my view, is that Britain was willing to give in peacefully to people like Gandhi and Nehru while France was not willing to give in peacefully to people like Ho Chi Minh. The French felt that they needed Vietnam for political and economic reasons. They felt that they could not give Algeria up because they felt it was an integral part of France. By contrast, Britain did not feel that it had to hold India or countries like Nigeria at all costs.
In my view, the major factor that determined whether decolonization was violent was the attitude of the colonial power towards the particular colony.