There is a lack of comprehensive measurements and systematic evaluations of the depression in caregivers of patients with psychiatric disorders and the factors influencing them in China. This study aims to explore the relationship between family function and depression in caregivers of patients with schizophrenia at the individual, family, and social levels according to the ecological system theory and attachment theory. In this study, multi-stage, stratified cluster sampling was adopted to sample caregivers of patients with schizophrenia as subjects from one to three counties of four counties in Yunnan, from September 2022 to March 2023. Collecting the current caregiver's demographic data, family functions, social support, care burden, depression and internalized stigma. The results of single-factor analysis show that age, education level, relationship with patients, and the degree of self-care of patients are the influencing factors of depression of people living with schizophrenia (p < 0.05). The scores of self-rating depression scale are higher for caregivers who have not received formal education, caregivers who cannot take care of themselves and the parents, spouses and children of patients. The results of Pearson correlation analysis show that depression is positively associated with internalized stigma and care burden, and negatively associated with social support and family function (p < 0.05). The results of multiple linear regression show that after controlling age, education level, the patient's self-care capacity, and relationship with patient, the internalized stigma (β = 0.184, p = 0.01) is positively correlated with depression. The mediation effect route of family function → social support → care burden → internalized stigma → depression was significant with 95% confidence interval [-0.150, -0.01], and the chained mediation effect was 5.904%. To reduce the depression level in family caregivers of schizophrenia, apart from taking measures to improve the caregiver's family function, enhancing social support, decreasing care burden, and reducing internalized stigma are suggested.