Prior to the events of the film, a Scientist is ordered by his dictator to create a machine in the apparent name of progress. The Scientist uses his own intellect to create the B.R.A.I.N., a thinking robot. However, the dictator quickly seizes it and integrates 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 becomes corrupted and decides to exterminate all life on Earth. The Fabrication Machine reprograms the other war machines to turn against humans by using toxic gas and chemical weapons. On the verge of destruction, the Scientist uses alchemy to create nine homunculus-like rag dolls known as “Stitchpunks” using portions of his own soul via a talisman and dies upon finishing the last one.
Sometime later, the last doll, 9, awakens in the Scientist’s workshop. Taking the talisman with him, 9 ventures into the devastated city and meets 2, a frail inventor who gives him a voice box and is surprised when 9 reveals the talisman. The last surviving machine, the Cat-Beast, attacks the pair and takes 2 and the talisman. 9 collapses, but awakens in Sanctuary, a cathedral that is home to other dolls, including the dogmatic leader 1, his large bodyguard 8, the cycloptic engineer 5, and the mentally unstable oracle 6. 1 immediately labels 2 as dead, but 9, having seen the factory where the Cat-Beast has taken 2, decides to rescue him. 9 and 5 venture to the factory where they find 2, and 7, the only female of the dolls, arrives and slays the Cat-Beast. 9, drawn by curiosity, connects the talisman to the previously derelict Fabrication Machine, causing it to absorb 2’s soul, reviving it and killing him in the process whilst 9, 5, and 7 manage to escape the factory…