GRB050904 is very interesting since it is by far the most distant GRB event known to date($z=6.29$). It was reported that during the prompt high energy emission phase, a very bright optical flare was detected, and it was temporal coincident with an X-ray flare. Here we use two models to explain the optical flare, One is the late internal shock model, in which the optical flare is produced by the synchrotron radiation of the electrons accelerated by the late internal shock, and the X-ray flare is produced by the synchrotron-self-Compton mechanism. The other is the external forward-reverse shock model, in which the optical flare is from the reverse shock emission and the X-ray flare is attributed to the central engine activity. We show that with proper parameters, a bright optical flare can appear in both models. We think the late internal shock model is more favored since in this model the optical flash and the X-ray flare have the same origin, which provides a natural explanation of the temporal coincidence of them. In the forward-reverse shock scenario, fits to the optical flare and the late afterglow suggests that the physical parameters of the reverse shock are much different from that of forward shock, as found in modeling the optical flash of GRB 990123 previously.