Purge & Notification
A 'ping me when the queue is done' node that also sweeps VRAM
- signal
- signal
Long batches in ComfyUI have the same failure mode as microwaving popcorn: you walk away, and the only way to know it's done is to keep checking. Purge & Notification is the end-of-workflow node from comfyui-ysnodes that fixes that - drop it after your last Save Image, and when the run finishes it plays a sound in your browser tab, pops an OS notification, and can flush VRAM while it's at it. You go make tea, you come back to a chime instead of a screen you've been babysitting.
It's actually two unrelated jobs welded into one node, and both are useful. The purge half is borrowed from the PurgeVRAM / LayerStyle lineage; the notification half comes from ComfyUI-Notifications. The pack just merges them and adds no dependencies.
How it works
Notifications in ComfyUI are a two-part system, and this is the part that trips people up:
- Python side (this node) does the purge immediately -
soft_empty_cache(), CUDA/MPS cache clear, and optionallyunload_all_models()- then sends a WebSocket message to the browser viaPromptServer.send_sync(). - JS side (
web/purge_notification_sg.js, auto-served by the pack) listens for that message and fires the OS notification and plays the audio.
Both files have to be present. The Python half alone gives you the purge; without the JS file, no sound and no notification - the README calls this out explicitly.
The inputs that matter
The node is an output node (OUTPUT_NODE = True), so it always runs at the end of execution. Its signal input is a wildcard - connect the last real node's output there to guarantee execution order.
purge_cache(default on) - clears the CUDA/MPS cache and ComfyUI's soft cache. Harmless to leave on; helps if you run long sessions where VRAM creeps up.purge_models(default off) - unloads all models from VRAM. This is the one to be careful with: the next run reloads everything from disk, so your first image after a purge_models run is noticeably slower. Turn it on only when you genuinely want to hand VRAM back.alert_mode-alwaysfires every run;on_empty_queuefires only when the queue is fully empty. If you batch ten jobs,on_empty_queuemeans one chime at the end instead of ten interruptions. That's the setting you actually want for batch work.notification_text,play_sound,sound_volume,sound_file- the message text and the audio.sound_fileaccepts a filename fromcomfyui-ysnodes/web/assets/(a defaultnotify.mp3ships with the pack), a full local path, or a URL.
Installing it
Same story as every node in this pack - zero dependencies, no models.
cd ComfyUI/custom_nodes
git clone https://github.com/MrYassinox/comfyui-ysnodes.git
Or search comfyui-ysnodes in ComfyUI Manager, then restart.
When the sound doesn't fire
The README's FAQ is the honest troubleshooting checklist:
web/purge_notification_sg.jsmust be present in the pack folder - if you cloned an old version or something's stripping theweb/directory, the JS half is gone and you get silence.- A sound file (e.g.
notify.mp3) must exist inweb/assets/. The pack ships one, but if you deleted it or renamed the file, updatesound_fileaccordingly.
And browser reality: OS notifications require the page to have notification permission, and sound needs the tab to not be throttled. If the node is running on a remote server you're viewing over SSH-tunneled port forwarding, the notification fires in that browser, not wherever you are.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| purge_cache | BOOLEAN | true | Clear CUDA/MPS cache and ComfyUI soft cache. |
| purge_models | BOOLEAN | false | Unload ALL models from VRAM. Next run reloads from disk. |
| alert_mode | COMBO | always | always = notify every run. on_empty_queue = only when queue is empty. |
| system_notification | BOOLEAN | true | Send a browser OS notification popup. |
| notification_text | STRING | ✅ Workflow complete | Text shown in the browser OS notification. |
| play_sound | BOOLEAN | true | Play an audio file in the browser tab. |
| sound_volume | FLOAT | 0.500–1 | Playback volume 0.0 (mute) to 1.0 (full). |
| sound_file | STRING | notify.mp3 | Sound to play. Can be: • Filename in comfyui-ysnodes/web/assets/ (e.g. notify.mp3) • Full local path (e.g. C:\Windows\Media\alarm.wav) • URL (e.g. https://example.com/alert.mp3) |
| signalopt | * | Connect last node output here to ensure correct execution order. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| signal | * | — |