Guns and gunpowder made two major contributions to the Industrial Revolution:
Gun and cannon manufacture was an important driver of precision manufacturing and the use of interchangeable parts. John Wilkinson's 1774 method for precise boring of iron cannons later allowed precise boring of cylinders for Watt's steam engines.
In the late 17th century, Christiaan Huygens attempted to build an internal combustion engine, using gunpowder as the fuel. It didn't work, due to combustion gasses escaping between the piston and cylinder (Wilkinson's borer might have helped), difficulty in getting uniform combustion, and solid residue remaining in the cylinder. Denis Papin was his main assistant in this work, and did a lot of the building. Later, Papin built a steam engine, which was an important intermediary between Thomas Savery's steam pump and Newcomen's steam engine. (He also invented a pressure cooker.)
Thus, guns and gunpowder accelerated the development of precision manufacture and the steam engine. However, the connection between gunpowder and the steam engine is peripheral, rather than central, and it seems that the steam engine could have, and probably would have, been invented anyway. Industrial machinery had already been introduced in the textile industry (using water power), and steam power (e.g., Savery's steam pump) was being used in the mining industry before the steam engine. To go from this state of affairs to steam power in factories took two major steps: the use of steam engines (such as the Newcomen engine) in mines, and Watt's improved engine which made steam engines efficient enough for factories. Neither of these steps required guns or gunpowder, even though historically these things contributed to them.
Certainly, guns and gunpowder were not enough to bring about a rapid industrial revolution. In both China and Japan, there was an increase in mining, iron-making, and manufacturing in the Early Modern period, but in neither case resulted in an industrial revolution.