It's an interesting thought, but I've always heard that the cotton gin was actually responsible for propping up slavery in the US south, as counter-intuitive as it that may seem?
That sounds like https://en.wikipedia.org/wiki/Jevons_paradox, and in fact the article has this snippet: "The expansion of slavery in the United States following the invention of the cotton gin has also been cited as an example of the effect.[12]"
True, but the cotton gin only made processing cotton more efficient. It didn't help in actually growing or harvesting it. So unfortunately, more efficient processing did encourage more production by manual (slave) labor.
One interesting factiod¹ is that a root cause for the transatlantic slave trade was that Africans were the only plantation workers that didn't die of malaria after a few years. Both local natives, and imported Europeans kept dying off.
¹ As in, I've seen it stated as fact, but am not sure how true it is
This does not counter OPs point. The invention caused the increased demand for slave labor. It wasn't slavery which caused the invention.
However, slavery didn't prevent (or even effectively compete with) the invention either, like the OP and many others have suggested about Roman slavery