Background/Objectives: In grid connected photo voltaic systems inverter is the key element. The inverter is required to shape dc current into sinusoidal current and provide fast response under various disturbances. The quality of power injected into the grid depends on proper inverter control. The objective of this paper is reducing harmonics and to improve power factor in grid connected system with balanced and unbalanced loads.Methods/Statistical analysis: In this study, three control mechanisms, adaptive neuro fuzzy inference system (ANFIS), ANFIS with static synchronous compensator (STATCOM), ANFIS with dynamic voltage restorer (DVR) are employed to improve power quality. The performances of fuzzy and ANFIS controllers are compared in terms of total harmonic distortion and power factor. MATLAB/ Simulink is used to perform the simulation. Findings: ANFIS controller is more effective compared to fuzzy controller. ANFIS controller with DVR gives less THD and improved power factor as compared to fuzzy controller.Novelty/Applications: Fuzzy and neural network controllers do not need any mathematical modelling and give accurate control as compared to classical PI controllers. In this work, ANFIS controller alone and ANFIS controller along with custom power devices STATCOM and DVR are designed for reduction in total harmonic distortion and improved power factor. The results are tabulated, analyzed and compared with fuzzy controller. It has been shown that ANFIS controller gives better performance compared to fuzzy controller. Keywords: Artificial neural networks (ANN); Adaptive neuro fuzzy inference system (ANFIS); fuzzy controller; power factor; power quality; Total Harmonic Distortion (THD)