In an alternate 1930s world, a scientist is ordered by his dictator, Chancellor Ferdinand, to create a robot in the apparent name of progress. The scientist creates the B.R.A.I.N, a highly intelligent robot without a soul. The dictator seizes it and turns it into the Fabrication Machine, an armature that can construct an army of war machines to destroy the dictator’s enemies. Lacking a soul, the Fabrication Machine decides to exterminate all of Earth’s population. The Fabrication Machine reprograms the other war machines to attack humanity, wiping out all plant, animal and microbial life with toxic gas and chemical weapons. On the verge of destruction, the scientist uses alchemy to create nine homunculus-like rag dolls known as “Stitchpunks,” giving them portions of his own soul via a talisman he created. He dies upon completion of the final doll.
Some time later, the final Stitchpunk, 9, awakens in the workshop. Taking the talisman with him, 9 ventures into the devastated city and meets 2, a frail inventor who gives him a working voice box and is surprised to see the talisman. The last active machine, the Cat-Beast, attacks the pair and abducts both 2 and the talisman. 9 collapses, but awakens in Sanctuary, the tower of an empty cathedral that is home to other Stitchpunks – the dogmatic leader 1, his large bodyguard 8, the cycloptic engineer 5, and the mentally unstable oracle 6. 1 immediately declares 2 as dead, but 9, having seen the condemned factory where the Cat-Beast took him, decides to rescue him. 9 and 5 venture to the factory where they find 2. The Cat-Beast attacks the trio, but are saved by 7, the only female of the Stitchpunks. 9, drawn by curiosity, connects the talisman to the derelict Fabrication Machine, reviving it, and it subsequently kills 2 by sucking out his soul. 9, 5, and 7 manage to escape the factory.
7 takes 9 and 5 to an abandoned library, where the silent scholar twins, 3 and 4, show 9 the Fabrication Machine’s origins. 5 realizes the talisman’s symbols match the clairvoyant drawings of 6. 9 and 5 return to Sanctuary to investigate, but 1 intervenes and reprimands them for disobeying his orders. Meanwhile, the Fabrication Machine assembles new robotic creatures; one of them, the bird-like Winged Beast, attacks Sanctuary, leading to a battle between it and the Stitchpunks. 7 joins the fight, but is injured. The Stitchpunks win, defeating the Winged Beast, however, they lose their safe-house, as a fire had started during the fight.
As the group retreats to the library, 6, 3, and 4 cryptically explain the talisman’s origins, but 1 reveals to the group that he sent 2 out of Sanctuary on a scouting trip to die (declaring that, “sometimes, one must be sacrificed for the good of many”). 7, shocked by this, attacks 1, but flees when 9 intervenes. Meanwhile, the Fabrication Machine retrieves 2’s corpse and uses it as a hypnotic lure for another one of its robot creatures, known as The Seamstress. The Seamstress attacks the library and captures both 7 and 8, but 2’s body is recovered and given a funeral by the others. The others then run to the factory to destroy the machines. 9 goes in alone, kills the Seamstress, and rescues 7, but not before 8’s soul is absorbed by the Fabrication Machine. 9 and 7 escape while the others destroy the factory.
The Stitchpunks celebrate the destruction of the factory, but the Fabrication Machine, which survived, suddenly emerges from the ruins of the factory and absorbs 5’s soul. The Fabrication Machine attacks the group as they run away, and finally captures 6, who is absorbed but has told 9 to go to the Scientist’s workshop to find answers. 9 follows 6’s instructions, finding a holographic recorded message from the Scientist, explaining B.R.A.I.N.’s origins and that the Stitchpunks have his soul, making them the only hope for humanity. Following this revelation, 9 the purpose of the talisman and returns to his friends
9 reunites with the other Stitchpunks and decides to sacrifice himself so the others can retrieve the talisman. Having had a change of heart, 1 redeems himself by saving 9, pushing him out of the way and allowing himself to be absorbed while 9 removes the talisman. 9 activates the talisman and reabsorbs the souls taken by the Machine, resulting in its final destruction. Afterwards, 9, 7, 3, and 4 free the souls of 5, 1, 6, 2, and 8 from the talisman as they fly up into the sky, causing it to rain. The final image shows that the raindrops contain small flecks of glowing bacteria, bringing life back into the world.