Clearing VRAM in ComfyUI frees up graphics card memory that is being held by cached models, intermediate tensors, and unfinished generations. This is useful when you hit out-of-memory (OOM) errors, when the UI becomes sluggish, or when you switch between large models. You don't need to restart the whole program—just clear the VRAM cache. Here's exactly how to do it.
What You'll Need
- A running ComfyUI instance (either the desktop app or the web interface served locally).
- Basic familiarity with the ComfyUI interface (the node graph and the menu bar).
- No special tools—everything is done through the built-in UI.
Step-by-Step
- Open ComfyUI and wait for the interface to fully load. You should see the node graph area and the top menu bar with options like "Queue", "View", and "Settings".
- Locate the "Clear" button in the top menu bar. It is usually on the right side, next to the "Load Default" button. The exact label may be "Clear" or show a trash icon.
- Click the "Clear" button. This clears the current workflow from the canvas, but it also releases the VRAM that was used by the loaded models and cached data. You will see the node graph become empty.
- If you want to keep your workflow but still clear VRAM, use the keyboard shortcut: press
Ctrl+Shift+C(Windows/Linux) orCmd+Shift+C(Mac). This clears the VRAM cache without removing your nodes. - Alternatively, use the "Free" button if you see one. Some versions of ComfyUI have a dedicated "Free" button (often near the queue button) that explicitly frees VRAM. Click it once.
- If you don't see a dedicated button, restart the ComfyUI process—close the terminal or the app window and relaunch it. This is the most thorough way to clear all VRAM.
- After clearing, verify that VRAM is freed by checking your GPU memory usage with a system monitor (like Task Manager on Windows, Activity Monitor on Mac, or `nvidia-smi` on Linux). You should see a drop in memory usage.
Common Mistakes
- Clicking "Clear" and expecting the workflow to remain. The "Clear" button removes the entire workflow from the canvas. Use the keyboard shortcut or the "Free" button instead if you want to keep your nodes.
- Assuming that clearing VRAM also clears the queue. The queue may still have pending jobs. Make sure to cancel or clear the queue separately if needed.
- Forgetting to clear VRAM after each large generation. If you're doing many generations in a row, VRAM can accumulate. Make it a habit to clear between heavy tasks.
- Using the wrong shortcut. The shortcut is
Ctrl+Shift+Con Windows/Linux, but on Mac it'sCmd+Shift+C. Using the wrong one may not do anything.
Tips
- Use the "Free" button if available. It's the most direct way to clear VRAM without disrupting your workflow.
- Monitor your VRAM usage. Tools like `nvidia-smi` (NVIDIA GPUs) or the Task Manager can help you see exactly how much memory is being used and when it's safe to clear.
- Clear VRAM before switching to a very large model. If you're going from a small model to a huge one, clearing first prevents OOM errors.
- If you're running ComfyUI in a browser, a page refresh can also help. It reloads the frontend and may release some cached memory, though it's not as thorough as clearing VRAM in the backend.
- Consider using the `--lowvram` or `--novram` flags when starting ComfyUI from the command line to reduce VRAM usage in the first place, but note that this may slow down generation.
Troubleshooting
- VRAM is still full after clicking "Clear". This can happen if there are still active processes holding memory. Try the keyboard shortcut, then restart ComfyUI if needed.
- The "Clear" button is greyed out. This usually means the UI is busy processing a generation. Wait for the current job to finish, or cancel it from the queue, then try again.
- You get an OOM error even after clearing. The model you're trying to load may simply be too large for your GPU's VRAM. Consider using a smaller model or enabling the low VRAM mode.
- Clearing VRAM causes your workflow to disappear. If you accidentally clicked "Clear" instead of "Free", you can reload your workflow from a saved JSON file. Always save your workflow before clearing.
- VRAM usage doesn't drop after restart. If the GPU memory is still high after a full restart, another process might be using it. Check your system's GPU usage to see if something else is holding the memory.
Frequently Asked Questions
Does clearing VRAM affect my current workflow?
If you use the "Clear" button, yes—it removes the workflow from the canvas. If you use the keyboard shortcut or the "Free" button, your workflow stays intact.
Will clearing VRAM make my generations faster?
Not directly. Clearing VRAM frees up memory, which can prevent slowdowns caused by memory swapping, but it doesn't speed up the actual generation process.
Can I clear VRAM while a generation is running?
It's not recommended. Wait for the generation to finish or cancel it first, otherwise the clear may not work and could cause errors.
Does clearing VRAM delete my saved models or checkpoints?
No, it only clears the memory cache. Your models and files on disk remain untouched.
Is there a way to automatically clear VRAM after each run?
ComfyUI doesn't have a built-in auto-clear option, but you can add a custom node or script that calls the clear function after each queue. Some community workflows include such nodes.
Why does VRAM usage increase over time even when I'm not generating?
ComfyUI keeps models and intermediate data in memory for faster reuse. This is normal. Clearing VRAM periodically will reset it.