
FP8 quantized Krea2 model triggers OOM when applying any LoRA — forced dequant/re-quant path doubles peak VRAM
快速结论:该问题在使用 FP8 量化版 Krea2 模型加载任何 LoRA 时触发 CUDA OOM。优先确认 PyTorch 版本是否已更新到 2.9.1+cu130 或更高版本,该版本明确修复了此问题。
问题场景
用户在 ComfyUI 0.27.1 版本中,使用社区微调的 Krea2 FP8 量化模型加载任何 LoRA 时触发。即使 LoRA 文件非常小,也会在采样准备阶段立即发生 OOM。不使用 LoRA 时模型工作正常,甚至可以处理 2K 分辨率。
报错原文
[ERROR] !!! Exception during processing !!! Allocation on device
[ERROR] Traceback (most recent call last):
File "D:\ComfyUI-aki-v1.4\execution.py", line 542, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
File "D:\ComfyUI-aki-v1.4\execution.py", line 341, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
File "D:\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Lora-Manager\py\metadata_collector\metadata_hook.py", line 171, in async_map_node_over_list_with_metadata
results = await original_map_node_over_list(
File "D:\ComfyUI-aki-v1.4\execution.py", line 315, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\ComfyUI-aki-v1.4\execution.py", line 303, in process_inputs
result = f(**inputs)
File "D:\ComfyUI-aki-v1.4\nodes.py", line 1641, in sample
return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise)
File "D:\ComfyUI-aki-v1.4\nodes.py", line 1571, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "D:\ComfyUI-aki-v1.4\comfy\sample.py", line 74, in sample
原因分析
当 FP8 量化的 Krea2 模型加载 LoRA 时,内部会强制触发去量化(dequant)-> 应用 LoRA -> 重新量化(re-quant)的操作路径。这个路径会将模型权重临时从 FP8 转换为更高精度再进行 LoRA 合并,导致峰值显存需求翻倍,从而触发 16GB VRAM 上的 OOM。
问题在 PyTorch 2.9.1+cu130 版本中已明确解决(用户报告更新后不再出现 OOM)。因此旧版本 PyTorch 中可能存在量化模型与 LoRA 合并时的显存管理缺陷。
环境排查
- 确认 ComfyUI 版本(建议升级到最新稳定版本)
- 确认 PyTorch 版本(必须 ≥ 2.9.1+cu130)
- 确认显卡型号和显存容量(16GB 显卡为临界点)
- 确认模型是否为 FP8 量化版本(关注日志中的
Found quantization metadata version 1和Detected mixed precision quantization) - 确认 LoRA 管理器 / ComfyUI-Lora-Manager 是否为最新版本
解决步骤
- 首先检查当前 PyTorch 版本。如果低于 2.9.1+cu130,优先升级 PyTorch。
- 升级 PyTorch 后重启 ComfyUI,重新加载 FP8 量化模型并应用任意 LoRA,检查是否仍然触发 OOM。
- 如果升级后问题依旧,可以尝试:不使用 LoRA 运行相同的工作流,确认问题仅出现在加载 LoRA 时(用于与其他模型对比确认是否为 Krea2 特有问题)。
- 可优先尝试:将模型转换为非量化版本(如 BF16/FP16)后加载 LoRA,作为临时规避方案。
验证方法
加载 Krea2 FP8 量化模型后,正常应用一个 LoRA 节点并执行采样。如果不再出现 CUDA OOM 报错且顺利生成图像,则问题已解决。



