9

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 Stitchpunks, 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. Meanwhile, 7, the only female of the Stitchpunks, 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.
7 takes 9 and 5 to the 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 confronts and chastises them. The Fabrication Machine starts constructing new machines; one of them, the bird-like Winged Beast, attacks Sanctuary, leading to a battle between the Stitchpunks and the Winged Beast. 7 joins the fight, but is injured. 5, 6 and 8 then manage to kill the Winged Beast.
As the group retreat to the library, 6, 3, and 4 cryptically explain the talisman's origins, but 1 once again chastises the group before revealing that he sent 2 out of the church on a scouting trip to die. Enraged, 7 lashes out at 1 before running off after 9 prevents her from delivering the killing blow. Meanwhile, the Fabrication Machine finds 2's corpse and uses it as a hypnotic lure for another robot, the Seamstress. The Seamstress attacks the library and captures 7 and 8, but 2's body is safely recovered and given a funeral by the others. The others then run to the factory to destroy the machines. 9 goes inside alone, kills the Seamstress, and rescues 7, but not before witnessing 8's soul getting 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 appears from behind and ends up absorbing 5's soul after surprising the other Stitchpunks. The Fabrication Machine soon attacks the group and eventually captures 6, who is absorbed but not before convincing 9 to go to the Scientist's workshop to find answers. 9 follows 6's instructions, finding a holographic recorded message from his creator, who explains that the Stitchpunks are all a part of himself, including 9, making them the only hope for humanity. He then explains that the talisman can be used against the Fabrication Machine to free the Stitchpunks' souls trapped in it.
9 reunites with the other Stitchpunks and devises a plan to sacrifice himself to allow the others to retrieve the talisman from the Fabrication Machine. However, 1, having had a change of heart, redeems himself after saving 9 by pushing him out of the way, allowing himself to be absorbed and giving 9 the opportunity to remove the talisman. The Fabrication Machine desperately tries to grab it in anger, but 9 activates it and uses it to reabsorb the souls taken by the Fabrication Machine, causing a massive explosion that destroys the Fabrication Machine in the process. 9, 7, 3, and 4 free the souls of 5, 1, 6, 2, and 8 from the talisman and 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 to the world.

Question: who kills the Seamstress, and rescues 7?
Answer: 9