A generalized Tian-Todorov theorem