Professor got me involved into working with him, but the experience was poor. How can I avoid him without facing negative consequences?
I would say there is no way to totally prevent badmouthing happening. You can adopt an extremely wise strategy to get yourself out of that shet, but, you know, he can (if he wants, of course) use the fact that you quit before you should to condemn you (I hope this will not happen.). So I think what you want is to be honest to him about how you felt. Try not to talk to him in a tone that judges; try to first report or state what you saw neutrally and then tell him how these led to your decision. If you can do this in a mature, unemotional, analytical way, and if he is at least a reasonable person, then I think you guys can break up peacefully. Be careful that you don't give him an impression that you did the decision majorly out of emotion; this would lead him to consider you an unprofessional "employee" (if this is the case, who knows what implications he can come up with to harm you; you want to minimize the potential negative consequences.) .

If you did the above, then simply walk away and pay no mind to the consequences.