Display avatar with comment form?

I’ll answer myself.
Add the following somewhere in functions.php or make it into a plugin:

add_action( 'comment_form_logged_in_after', 'psot_comment_form_avatar' );
add_action( 'comment_form_after_fields', 'psot_comment_form_avatar' );
function psot_comment_form_avatar()
{
  ?>
   <div class="comment-avatar">
     <?php 
     $current_user = wp_get_current_user();
     if ( ($current_user instanceof WP_User) ) {
        echo get_avatar( $current_user->user_email, 32 );
     }
     ?>
   </div>
<?php
}