To prepare the pesto, combine basil, garlic, walnuts, and Parmesan in a food processor. Add salt and pepper to your liking, then blend until smooth. Slowly drizzle in olive oil while blending until it emulsifies.
Evenly spread the pesto on all 4 bread slices. Place two slices on a panini maker or in a toaster oven for about 2 minutes to lightly toast them.
Next, layer mozzarella slices, tomatoes, and roasted red peppers on the toasted bread slices. Let the cheese melt and the vegetables soften slightly, leaving the panini maker open during this step.
Once the mozzarella begins to melt, top with the remaining slices of bread to form sandwiches. Close the panini maker and cook for an additional 2-3 minutes until the sandwiches are golden and crispy.
Remove, cut in half, and serve right away.