Mix the baking powder, salt, and cayenne with the flour. Set aside.
Melt the chocolate chips and butter in a pan set over a pot of simmering water. Stir occasionally until the chocolate and butter are melted and smooth. Set aside.
In another bowl, mix the pumpkin with the oil, cinnamon and nutmeg.
In a large bowl or the bowl of a stand mixer, beat the tofu, sugar and vanilla for about 3 minutes or until the mixture is smooth and homogeneous.
Add the flour and beat it in until it is just mixed. Scrape down the sides with a spatula to mix everything well together.
Pour half the batter into the bowl with the pumpkin mixture. Mix thoroughly so everything is well incorporated.
To the remaining half of the batter, add the chocolate mixture and mix well.
Line a 9-inch square baking pan with parchment paper or foil, shiny side down. Coat the foil with some vegan butter or oil.
Pour half the chocolate batter into the bottom of the pan. Smooth it out to the corners in an even layer using a rubber spatula.
Pour half the pumpkin batter on top of the chocolate and smooth again.
Repeat with the remaining chocolate batter and finally the remaining pumpkin batter. Make sure you smooth out each layer so its spread evenly. The batter's not very liquid, so its a little like spreading frosting on a cake.
Sprinkle the top with walnuts. Then bake in a preheated 350-degree oven for 45-50 minutes.
Remove to a rack, cool, then remove from the pan using the foil overhang as handles. Cut and serve.