Preheat air fryer to 320°F (160°C) for 3 minutes
Mash ripe bananas in a large bowl until smooth
Add melted butter brown sugar eggs and vanilla extract
Mix until fully combined
Add flour baking soda baking powder cinnamon and salt
Fold gently until just combined — do not overmix
Fold in walnuts if using
Spray a 7 inch cake pan or air fryer safe loaf pan with cooking spray
Pour batter into prepared pan
Place pan in air fryer basket
Cook for 25 minutes until golden and a toothpick comes out clean
Check at 20 minutes — if top is browning too fast cover loosely with foil
Cool for 10 minutes before slicing
Serve warm with butter