The Fabrication Machine, also known as the "B.R.A.I.N", is the source of the machines, and is the main agonist of the movie.
The B.R.A.I.N seems to have no thought or remorse for any living thing. The Fabrication Machine was the creation of a scientist to help build robots to aid in the world war. The military had taken it away when the scientist realized that he did not give it a human soul. The B.R.A.I.N soon snapped under pressure, and began to reprogram the other machines into attacking humanity. The machine was shut down soon after, though its creations went on to destroy all life.
Its last surviving creation was the Cat Beast, who still sought out to kill all organic life, which was no more than the stitch punks that the scientist had created. When the beast took 2 who was carrying the talisman, 9 and 5 went after them. After a long battle, 7 swoops in and kills the beast, and 9 being curious of the purpose of the talisman, sticks it in a nearby slot. The talisman starts to glow, and soon steals 2's soul. The slot was actually attached to the fabrication machine, who soon woke up to find its unwelcomed guests. After a long run from the machine, the stitch punks finally make it out and back to the church. The machine, finally back up and running, builds the Winged Beast to go and capture them. In the time the stitch punks are battling the beast, the B.R.A.I.N builds hot air balloon-like creations that collect garbage from the streets, and keep a lookout for the punks. It also built the Seamstress to go and aid in the destruction. The Seamstress had brought back 8 and 7. 7 was saved with the help of 9, but 8's soul had been taken. When they escaped the fortress, they took a barrel of oil with a lit fuse, and threw it into the gas filled building. It exploded, and destroyed all of the robotic creatures that haunted the Earth.
With a celebration at hand, 5 chases after a fallen record. He approaches the site of the explosion, and the Fabrication Machine rises out from the ground, no longer stationary. He gets to the others to warn them, but the machine grabs 5 and steals his soul. After a short, grieving chase, the machine soon ends up stuck on a split bridge with it hanging from one half as if in a cage. 6 explains how the souls are still strapped inside the monster, and can only be freed if they go back to the source. 6 is quickly snatched up, and his soul is taken from him. After 9 sets out on a journey, he learns all about himself and the machine. He also learns how the talisman works, and he quickly rushes back to the team. He finds the others launching what ever they can find at the machine. It takes mild damage as it storms toward their position. 9 shows them how they can use the talisman against the beast, just as it finds them and tries to torch them. 9 nearly sacrifices himself just as 1 jumps in the way to save him. 1 dies just as 9 is able to retrieve the talisman. He uses the sequence buttons just as the scientist had showed him, and the machine is heard screaming. The souls escape its body, and it loses its immortality. The machine sparks and twitches as it has no fuel source. The head blows up in an explosion of metal and electricity, and the menace is over.