Preheat your oven to 350°F (175°C). Grease a 9x5-inch loaf pan or line it with parchment paper.
In a large mixing bowl, combine the mashed sweet potatoes, granulated sugar, brown sugar, vegetable oil, eggs, and vanilla extract. Mix until well combined and smooth.
In another bowl, whisk together the flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
Gradually add the dry ingredients to the sweet potato mixture, stirring until just combined. Be careful not to overmix. If using, fold in the chopped nuts.
Pour the batter into the prepared loaf pan and smooth the top with a spatula.
Bake in the preheated oven for 55-65 minutes, or until a toothpick inserted into the center comes out clean. If the top starts to brown too quickly, cover it loosely with aluminum foil.
Once baked, remove from the oven and let it cool in the pan for about 10 minutes. Then, transfer the bread to a wire rack to cool completely before slicing.