Diaconescu for sheaves