In a large bowl, mash the ripe bananas with a fork until mostly smooth with a few small chunks remaining. Stir in the melted unsalted butter, granulated sugar, and brown sugar until combined.
Add the egg and vanilla extract to the banana mixture and mix until well incorporated.
In a separate bowl, whisk together the all-purpose flour, baking soda, baking powder, salt, and ground cinnamon. Pour the dry ingredients into the wet ingredients and fold gently with a spatula until just combined - a few small lumps are fine. Fold in the chopped walnuts if using.
Spray a 6-inch round or 7-inch loaf air fryer-safe pan with nonstick cooking spray. Pour the batter into the pan and smooth the top.
Preheat the air fryer to 310 degrees F. Place the pan in the air fryer basket. Air fry for 30 to 35 minutes, checking at the 25-minute mark. The banana bread is done when a toothpick inserted into the center comes out clean or with a few moist crumbs.If the top begins to brown too much during cooking, cover loosely with a small piece of aluminum foil.
Remove the pan from the air fryer and let the banana bread cool in the pan for 10 minutes. Then turn it out onto a wire rack to cool further. Slice and serve warm or at room temperature.