Add regenerate_if_different to regenerate when size or type changes