[Bug] KSampler preview error when using –preview-method auto with live preview enabled

该报错通常出现在 ComfyUI 以 --preview-method auto 启动、且采样过程中启用了实时/动态预览,并使用 KSampler 的场景。已确认的冲突来源是 ComfyUI-bleh 插件与 VideoHelperSuite 的动画预览预处理不兼容,优先排查并关闭 ComfyUI-

快速结论:该报错通常出现在 ComfyUI 以 --preview-method auto 启动、且采样过程中启用了实时/动态预览,并使用 KSampler 的场景。已确认的冲突来源是 ComfyUI-bleh 插件与 VideoHelperSuite 的动画预览预处理不兼容,优先排查并关闭 ComfyUI-bleh 的预览选项。

适用环境:Issue 中确认的环境为 Windows(路径为 E:\StableDiffusion\ComfyUI-aki-v1.7),ComfyUI 版本 8a43c6bd92499db45dd6b829b118f88dce9ce229,ComfyUI-VideoHelperSuite 版本 4d907bee61e92c2e65af3bd6383a4e4d356126d1,启动参数 --preview-method auto,并在采样时启用了 live/dynamic preview。额外安装了 ComfyUI-bleh 与 ComfyUI-Lora-Manager 插件。

最快修复方案:按 ComfyUI-bleh 的配置方式,在其 blehconfig.yaml 中关闭预览选项,无需修改 VideoHelperSuite 即可避开冲突。

注意事项:关闭 bleh 预览会失去该插件提供的预览能力;若希望两者共存并保留预览,需要手动修改 VideoHelperSuite 源码,该补丁属于社区验证方案,升级插件后可能被覆盖或需要重新应用。Issue 未提供具体 blehconfig.yaml 字段名,请以 ComfyUI-bleh 官方示例配置为准。

问题场景

用户使用 ComfyUI-VideoHelperSuite 时,在启动参数中加入 --preview-method auto,并在采样过程中开启 live/dynamic preview,然后运行包含 KSampler 的工作流。KSampler 在 latent_preview.prepare_callback 阶段触发预览异常。相同条件下自定义采样器(Custom samplers)则工作正常。

报错原文

[ERROR] !!! Exception during processing !!! Unsupported preview type for VHS animated previews
Traceback (most recent call last):
  ...
  File "ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\latent_preview.py", line 114, in get_latent_video_previewer
    return WrappedPreviewer(previewer, rate_setting)
  File "ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\latent_preview.py", line 31, in __init__
    raise Exception('Unsupported preview type for VHS animated previews')
Exception: Unsupported preview type for VHS animated previews

原因分析

根据 Issue 评论确认,该问题由 ComfyUI-bleh 插件引起。ComfyUI-bleh 会改变采样预览的实现方式,使传入的 previewer 对象不再具备 VideoHelperSuite 所期望的属性。VideoHelperSuite 的 WrappedPreviewer 在初始化时无法识别该预览类型,于是抛出 Unsupported preview type for VHS animated previews

也就是说,这不是 KSampler 本身的问题,而是预览插件与 VideoHelperSuite 动画预览包装逻辑之间的兼容冲突;Custom samplers 走的是另一条预览路径,因此不受影响。

环境排查

  • 确认 ComfyUI 启动参数是否包含 --preview-method auto
  • 确认采样时是否启用了 live/dynamic preview。
  • 确认是否安装了 ComfyUI-bleh,并检查其预览选项是否开启。
  • 确认 ComfyUI 与 ComfyUI-VideoHelperSuite 的提交版本是否与 Issue 中一致,或是否在冲突版本范围内。
  • 确认是否同时安装了其他会修改预览回调或 latent preview 的插件(如日志中出现的 ComfyUI-Lora-Manager);虽然 Issue 未将其认定为原因,但可作为排查变量。
  • 确认触发工作流使用的是 KSampler;若使用自定义采样器正常,可佐证与 VHS 预览包装的冲突。

解决步骤

  1. 先定位冲突插件:在 ComfyUI 中检查是否安装了 ComfyUI-bleh。
  2. 方案一(Issue 明确给出的首选方案):按照 ComfyUI-bleh 的配置说明,在其 blehconfig.yaml 中关闭预览选项,避免 bleh 接管采样预览。
  3. 重启 ComfyUI,再次运行原先会报错的 KSampler 工作流,确认不再出现 VHS animated previews 异常。
  4. 方案二(若希望 VideoHelperSuite 与 ComfyUI-bleh 共存并保留预览):打开 ComfyUI-VideoHelperSuite/videohelpersuite/latent_preview.py
  5. 将第 28 行改为:self.latent_rgb_factors_bias = getattr(previewer, 'latent_rgb_factors_bias', None)
  6. 在第 113 行之后新增以下兼容逻辑:
        if not (hasattr(previewer, 'taesd') or hasattr(previewer, 'latent_rgb_factors')):
            factors = getattr(latent_format, 'latent_rgb_factors', None)
            if factors is None:
                return previewer
            previewer = latent_preview.Latent2RGBPreviewer(
                factors,
                getattr(latent_format, 'latent_rgb_factors_bias', None),
                getattr(latent_format, 'latent_rgb_factors_reshape', None),
            )
  7. 保存文件并重启 ComfyUI,使补丁生效。

验证方法

在应用上述任一方案后,重新以 --preview-method auto 启动并启用 live/dynamic preview,运行包含 KSampler 的工作流。如果预览正常显示且日志中不再出现 Unsupported preview type for VHS animated previews,即表示冲突已解决。若使用方案二,还需确认 ComfyUI-bleh 与 VideoHelperSuite 的预览功能都能正常共存。

参考来源

Kosinkadink/ComfyUI-VideoHelperSuite #714

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

这个方案解决了吗?

celebrityanime
celebrityanime
文章: 22892

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注