报错
019
显存与内存不足(OOM)
含未核实说明
启动参数怎么选:--lowvram / --novram / --highvram / --normalvram / --gpu-only / --reserve-vram / --disable-smart-memory 的真实语义
报错原文(原样)
--lowvram Doesn't do anything if dynamic vram is enabled. If dynamic vram isn't being used this option makes the text encoders run on the CPU. --novram When lowvram isn't enough. --highvram By default models will be unloaded to CPU memory after being used. This option keeps them in GPU memory. --gpu-only Store and run everything (text encoders/CLIP models, etc... on the GPU). --reserve-vram Set the amount of vram in GB you want to reserve for use by your OS/other software. By default some amount is reserved depending on your OS. --disable-smart-memory Force ComfyUI to agressively offload to regular ram instead of keeping models in vram when it can. --async-offload Use async weight offloading. An optional argument controls the amount of offload streams. Default is 2. Enabled by default on Nvidia.
检索关键词
--lowvram、--novram、--highvram、--normalvram、--gpu-only、--reserve-vram、--disable-smart-memory、--async-offload、--disable-dynamic-vram
先看这一句
显存不够时把网上看到的参数全抄一遍,结果有的参数互相冲突(vram_group 是互斥组),有的在新版完全不起作用,甚至更慢或更容易 OOM。
适用版本 参数语义以新版(含 Dynamic VRAM)为准;--lowvram 在启用 Dynamic VRAM 时不生效是 0.3.x 之后的新行为。
·
核实日期 2026-09-26
·
状态 可能已过期,正在复核
适用环境:Windows 便携版、秋叶/绘世整合包、ComfyUI Desktop、Linux + 云 GPU、Docker/服务器
现象与触发场景
常见触发场景:
- 用户按旧教程加 --lowvram,但新版启用 Dynamic VRAM 后该参数不起作用
- 同时写了 --lowvram 与 --highvram 导致参数解析报错
- 照抄 --gpu-only 反而把文本编码器压到显存里,直接 OOM
根因
- comfy/cli_args.py 中 --gpu-only、--highvram、--lowvram、--novram、--cpu 属于同一个互斥组(vram_group),同时只能用一个。
- 新版 ComfyUI 默认启用 Dynamic VRAM,--lowvram 的 help 已明确写着 'Doesn't do anything if dynamic vram is enabled';需要通过 comfy/cli_args.py 中 is_dynamic_vram 的判断(args.disable_dynamic_vram 等)来理解实际生效逻辑。
- 所以“抄参数”在旧版教程与新版行为之间会产生完全相反的效果。
解决步骤
已按「最可能有效」排序。请从上往下做,每做完一步用「验证」确认,不要一次改五处。
- 先分清互斥组,只选一个显存模式--gpu-only / --highvram / --lowvram / --novram / --cpu 五选一。显存不足时不要用 --gpu-only 和 --highvram(它们是把模型更多放进显存),依次尝试 --lowvram -> --novram -> --cpu。--cpu 官方 help 注明是“very slow but works with any hardware, only use as absolute last resort”。python main.py --lowvrampython main.py --novrampython main.py --cpu
- 用不冲突的独立参数控制显存与内存--reserve-vram、--disable-smart-memory、--async-offload、--preview-method、--cache-* 都不在互斥组里,可以和显存模式参数叠加。推荐的小显存组合是:--reserve-vram 1-2 + --disable-smart-memory + --preview-method none。python main.py --reserve-vram 2 --disable-smart-memory --preview-method nonepython main.py --novram --disable-smart-memory --cache-none
- 新版不确定时先看启动日志,再决定是否需要 --disable-dynamic-vram启动日志会打印 'Set vram state to: ...'。若已启用 Dynamic VRAM,--lowvram 无效,应按需改用 --vram-headroom(为 DynamicVRAM 额外保留的显存 GB 数)或 --disable-dynamic-vram 回到旧的按估算加载模式。注意 --disable-dynamic-vram 在部分场景会更快但更吃显存(issue #16551 报告禁用后同工作流从 1.07 it/s 提升到 1.72 it/s)。python main.py --vram-headroom 1python main.py --disable-dynamic-vrampython main.py --disable-smart-memory --preview-method none
- AMD 用户可参考的实测组合官方 issue #11624 的作者在 RX 7900 XTX 上做了大量对比,结论是 --use-pytorch-cross-attention --disable-smart-memory 组合最快且在高负载下最不容易崩;该 issue 建议把这两个参数写进 run_amd_gpu.bat 的默认命令行。.\python_embeded\python.exe -s .\ComfyUI\main.py --windows-standalone-build --use-pytorch-cross-attention --disable-smart-memory
验证是否修好
启动日志中 'Set vram state to:' 与预期一致;用参前后对比同一工作流的峰值显存与单步耗时,确认参数真的生效而不是被互斥组忽略。
补充说明
本条 error_text 逐行摘自 comfy/cli_args.py(master 分支)中各参数的 help 原文。注意:旧教程中常见的 --normalvram 在当前 cli_args.py 的 vram_group 里已不存在(只有 --gpu-only/--highvram/--lowvram/--novram/--cpu),传 --normalvram 会报未识别参数;官方排障文档未列出该参数。[未核实] 具体从哪个版本起移除 --normalvram 未逐版本核对。 [未核实] 本条解决步骤中提到的那组性能对比数字(禁用 dynamic VRAM 后同一工作流 1.07 it/s → 1.72 it/s)出自 issue #16551,本次合稿复核未能在搜索引擎侧独立确认该 issue 是否存在,请把这组数字当作待验证的参考值,不要作为决策依据。本条其余结论(各参数的官方 help 原文、--normalvram 已不存在、--lowvram 在 dynamic vram 下失效)均已与本机 ComfyUI 0.37.0 的 comfy/cli_args.py 逐条核对一致,不依赖该 issue。
来源
按可信度排列:官方 issue / 官方文档 > 节点仓库 issue > 社区帖 > 中文社区文章。
链接以纯文本给出(本站不做站外跳转),需要核对时请自行复制到浏览器打开。
- [35] (官方文档) ComfyUI/comfy/cli_args.py(参数与 help 原文) https://github.com/Comfy-Org/ComfyUI/blob/master/comfy/cli_args.py
- [6] (官方文档) How to Troubleshoot and Solve ComfyUI Issues - ComfyUI Documentation https://docs.comfy.org/troubleshooting/overview
- [56] (官方 issue) update default command-line arguments for run_amd_gpu.bat · Issue #116 https://github.com/Comfy-Org/ComfyUI/issues/11624
- [57] (官方 issue) Dynamic VRAM prevents native FP8 compute for weight_dtype fp8_e4m3fn_f https://github.com/Comfy-Org/ComfyUI/issues/16551
本条的可靠性边界
下面这些位置带
[未核实] 标记,是采集时没找到一手来源的部分,请自行验证:
- 补充说明
这条报错要用到的东西
按本条报错所属的类别(显存与内存不足(OOM))列出站内相关的下载包与板块入口。 它们不是「必须下载才能修好」,而是这一类问题里最常要动到的东西;具体怎么做,以上面的解决步骤为准。
ComfyUI 权重库(167 个文件 / 约 1187 GB)按 ComfyUI 的 models 目录分好类的 167 个权重文件 / 每个文件一份说明(放哪、被哪些工作流引用)
待挂载
权重库同一个模型常有更小的量化版本,换一个能省一大截显存
板块
工作流换一条依赖更轻的工作流
板块
同一类别的其他条目
【012】最典型的爆显存:KSampler 阶段 torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate ...
有来源
【013】新版报错:torch.OutOfMemoryError: Allocation on device 0 would exceed allowed memory.(附带 batch_size TIPS)
有来源
【014】VAE 解码阶段爆显存:Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding
有来源
【015】系统内存/页面文件不足:OSError: The paging file is too small for this operation to complete. (os error 1455)
含未核实
【016】Windows 共享显存(Shared GPU memory)被吃满,任务管理器显示显存未释放、必须重启
含未核实
这个解法对你有效吗
记录只存在你自己的浏览器里,不需要注册账号。
知仓学习社