Ac only works when reving the engine

OK so I have a 2009 Honda accord ex coupe and the Ac works fine when I’m driving but once I stop it stops and the air starts to get warmer but if I rev it at a red light the Ac starts to work and I have nice cold air. Both radiator and condenser fan work and are spinning and the same time when the Ac is on. The compressor will cycle on and off at idle but it will turn on for maybe two seconds. And turn off but if I have some one rev the engine it will kick on and stay on at about 1500rpm and the Ac works normally I have no leaks

Check the tension of the AC drive belt. It may be slipping. Beyond that…visit an independent AC repair shop and have your AC system checked out.

Does it blow cold air if you turn the fan on high? I had a blown fan resistor, plenty cool while driving but warmed up when driving very slow and at stops. Ended up the fan was not blowing any air on speeds 1 and 2, which is all I ever used.

I have no leaks

I wouldn’t bank on that. I’d almost bet you are low on refrigerant.

Yea the the Ac works if I’m idleing and I rev it to 1500rpm the compressor works normally no matter what the fan speed its just as soon as it revs at 750 rpm I feel like the compressor doesn’t stay on long enough to do anything it will stay on for 2 secs at best then stop for a good 20-30 secs then run again

I’m leaning towards @PvtPublic on this one. Low refrigerant.

You do have a leak, but it might not need fixing. I have owned cars that needed a can of refrigerant in the spring that were good until next spring. And if it improves with revs, you are not very low.