Heterocyclic compounds, and pharmaceutical compositions thereof, are disclosed as RORγt modulators that have a formula represented by the following:and wherein n1, n2, R1, R2, R3, and R4 are as described herein. These compounds may be used for the prevention and treatment of a variety of conditions in mammals including humans, including by way of non-limiting example, inflammatory conditions, autoimmune disorders, cancer, and graft-versus-host disease.