How to Clear VRAM in ComfyUI

Back
Team Aquanode

Team Aquanode

Ansh Saxena

NOVEMBER 13, 2026

To clear VRAM in a running ComfyUI, send a POST request to its /free endpoint with unload_models and free_memory set to true. Restarting the ComfyUI process also frees everything.

The /free endpoint

ComfyUI's server defines POST /free and reads two flags from the JSON body: unload_models and free_memory. Between jobs, the queue worker then unloads all models, and with free_memory also resets the executor and garbage-collects.

curl -X POST http://127.0.0.1:8188/free \
  -H "Content-Type: application/json" \
  -d '{"unload_models": true, "free_memory": true}'

Change the host and port if you run ComfyUI elsewhere (the default is 8188, see the ComfyUI default port). The request takes effect when the queue worker next checks its flags, so it is applied right after the running job finishes.

Keep memory from filling in the first place

  • --disable-smart-memory makes ComfyUI offload to RAM instead of keeping models in VRAM.
  • --highvram is the opposite: it keeps models on the GPU after use.

If the real problem is an error, read how to fix a ComfyUI out of memory error. For the rest of the install and node side, see the ComfyUI custom node install guide.

Sources

#comfyui questions#comfyui vram

ComfyUI on our compute

Rent a GPU with ComfyUI already installed. Your custom nodes and models are there next time. $29 a month, or pay as you go.

Start ComfyUI

Start ComfyUI on a rented GPU.

Sign up in 60 seconds. Pay for the GPU minutes you actually use.

© 2026 Aquanode. All rights reserved.

All trademarks, logos and brand names are the property of their respective owners.