I had the exact same problems , and the fault was the injectors...take them for cleaning or change them with new ones , also the fuel pressure regulator...
i did this and everything came back to normal again... ( to get there i had to try new idle valve , new afm , new hoses , new ECU , new oxygen sensor - i tried all this and still with problem , then i changed the injectors and the fuel pressure regulator and suddenly everything fixed... )