Based on the analysis of closed-loop distribution network with dual sources to realize fault seamless self-healing, as well as considering the active power loss of the network and the voltage deviation of load nodes, a comprehensive optimal power flow control method of distribution network with closed-loop operation based on the unified power flow controller(UPFC) is proposed. This paper analyzes the optimal power flow distribution law of closed-loop distribution network and obtains internal relationship between the active power loss, voltage deviation of load nodes and series compensating voltage produced by the UPFC. The membership functions of the active power loss of distributed network and the voltage deviation at load nodes are respectively built, in order to represent degrees of them deviating from the optimal object. And the comprehensive optimal objective function is set up by the weighted average method. Finally, the serial connect compensation voltage is solved with the global optimal algorithm. The modeling and simulation results show that this method can balance the power output on two side, can effectively control all node voltage deviation, reduce active power loss of the network so as to lay the foundation for implementing the technology of seamless fault self-healing.