Comfy-Org / Comfy-Org/ComfyUI_frontend
[Bug]: VRAM usage extremely high in Firefox browser
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
### Frontend Version
```
About
ComfyUI 0.3.27
ComfyUI_frontend v1.14.5
System Info
OS
posix
Python Version
3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0]
Embedded Python
false
Pytorch Version
2.6.0+cu124
Arguments
main.py --disable-all-custom-nodes --cpu
RAM Total
62.62 GB
RAM Free
57.6 GB
```
### Expected Behavior
I expect comfy to use around 100-200MB of VRAM for display in browser
### Actual Behavior
nvidia-smi
firefox-nightly 2108MiB
(same with stable)
### Steps to Reproduce
1. main.py --disable-all-custom-nodes --cpu
2. open ComfyUI in Firefox and starting panning like wild
If I use `firefox -safe-mode` to turn hardware acceleration off it works of course
### Debug Logs
```powershell
default browser VRAM usage:
Sat Mar 29 08:35:14 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.15 Driver Version: 550.54.15 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4060 Ti On | 00000000:01:00.0 On | N/A |
| 0% 44C P5 18W / 165W | 633MiB / 16380MiB | 11% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 1461 G /usr/lib/xorg/Xorg 205MiB |
| 0 N/A N/A 2099 G cinnamon 54MiB |
| 0 N/A N/A 58002 G /usr/lib/firefox-esr/firefox-esr 241MiB |
| 0 N/A N/A 61214 G firefox-nightly 118MiB |
+-----------------------------------------------------------------------------------------+
once I start panning frantic in comfyui:
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 1461 G /usr/lib/xorg/Xorg 205MiB |
| 0 N/A N/A 2099 G cinnamon 54MiB |
| 0 N/A N/A 58002 G /usr/lib/firefox-esr/firefox-esr 243MiB |
| 0 N/A N/A 61214 G firefox-nightly 2108MiB |
+-----------------------------------------------------------------------------------------+
```
### Browser Logs
I installed firefox-nightly specifically to pin this issue down and use a fresh firefox installation. nightly is the only version that is supposed to support memory tracking, unfortunately I was not able to see GPU VRAM usage in Firefox
```
wget https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US
tar xf firefox-138.0a1.en-US.linux-x86_64.tar.xz
sudo mv firefox /opt/firefox-nightly
sudo ln -s /opt/firefox-nightly/firefox /usr/local/bin/firefox-nightly
firefox-nightly &
```
`about:memory`
```
-- ac2d-textures-...
-- gfx
── gfx
28,476.11 MB ── vsize
```
there are some gfx entries that appear useful but the memory usage doesn't add up
https://firefox-source-docs.mozilla.org/performance/memory/about_colon_memory.html
> “resident”. Physical memory usage. If you want a single measurement to summarize memory usage, this is probably the best one.
> “vsize”. Virtual memory usage. This is often much higher than any other measurement (particularly on Mac). It only really matters on 32-bit platforms such as Win32. There is also “vsize-max-contiguous” (not measured on all platforms, and not shown in this example), which indicates the largest single chunk of available virtual address space. If this number is low, it’s likely that memory allocations will fail due to lack of virtual address space quite soon.
> Various graphics-related measurements (“gfx-*”). The measurements taken vary between platforms. Graphics is often a source of high memory usage, and so these measurements can be helpful for detecting such cases.
`about:processes`
only shows CPU, no GPU or VRAM
`about:profiler`
[x] Memory Tracking

unfortunately I only see SRAM (tooltip is gone but it was about 4MB)
> Disabled Features
> Memory Tracking
> Track the memory allocations and deallocations per process over time.
if you see this, you need nightly
### Setting JSON
.
### What browsers do you use to access the UI ?
Mozilla Firefox
### Other Information
_No response_
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-3272-Bug-VRAM-usage-extremely-high-in-Firefox-browser-1c56d73d365081a09b1be0967b1e1a39) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.