Preheat the oven to 350°F (175°C). Grease and flour the loaf pan or line it with parchment paper for easy removal.
In a mixing bowl, whisk together the flour, baking soda, baking powder, salt, and spices (cinnamon, nutmeg, ginger, cloves) until well combined.
In another large bowl, mix the granulated sugar, brown sugar, pumpkin puree, vegetable oil, eggs, and vanilla extract until smooth and well combined.
Gradually add the dry ingredients to the wet ingredients, mixing gently until just combined. Be careful not to overmix.
If using, fold in the chopped walnuts or pecans at this stage.
Pour the batter into the prepared loaf pan and smooth the top with a spatula.
Bake in the preheated oven for 60 minutes, or until a toothpick inserted into the center comes out clean.
Once baked, remove from the oven and let cool in the pan for about 10 minutes, then transfer to a wire rack to cool completely.