Through CRISPR-Cas9 inactivation of B2M and CIITA and lentiviral transfection carrying CD47 gene, the engineered HiPSCs-derived islet cells survived in immunocompetent, allogeneic diabetic humanized mice for 4 weeks and ameliorated diabetes at least 29 days and rhesus macaques hypoimmune iPSCs-derived islets survived for 40 weeks in an allogeneic recipient without immunosuppression. This evidence concerns the gene CIITA and diabetes mellitus.