Depends on your model of capital flow. One reasonable answer would be the factory owners or investors. Another reasonable answer is that the workers did, because their work led enabled the factory to succeed.
The workers whose labour generated the value the looms were paid for with. To some extent, also the workers that put together the looms while only being paid a fraction of the value they created.