Preheat oven to 350°F (175°C) and lightly grease a 9x13-inch baking dish.
If using fresh peaches, toss sliced peaches with sugar and lemon juice and let sit 5–10 minutes to macerate.
Slightly drain canned peaches if using to avoid excess syrup, reserving a little for moisture if desired.
Spread the peaches evenly in the prepared baking dish, including any reserved juices.
Sprinkle cinnamon over the peaches if using and scatter chopped nuts if desired.
Evenly pour the dry yellow cake mix over the peaches; do not stir.
Drizzle the melted butter evenly over the cake mix so it soaks through and forms a crumbly top.
Bake in the preheated oven for 35–45 minutes until the top is golden and the fruit juices are bubbling around the edges.
Remove from oven and let cool 10–15 minutes so the filling thickens slightly for easier serving.
Serve warm, topped with vanilla ice cream or whipped cream if desired.