Comfy-Org / Comfy-Org/ComfyUI_frontend

useGLSLPreview: restore hideOutputImages on shader re-render failure

Open
#10,354 0 comments 0 reactions 1 assignee Claimed by @jtydhr88 View on GitHub
area:previews Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

In `src/renderer/glsl/useGLSLPreview.ts`, once `hideOutputImages` is set to `true` after a first successful live preview, a subsequent render cycle that fails (e.g. the user edits the shader source and introduces a compile error, or WebGL context is lost) will leave the preview area blank — `lastError` is set but the original output images remain hidden and no replacement preview is available.

## Repro

1. Open a `GLSLShader` node that has at least one successful backend execution.
2. The live preview activates and `hideOutputImages` flips to `true`.
3. Edit the fragment shader to introduce a compile error.
4. The re-render attempt fails; `lastError` is populated but `hideOutputImages` stays `true`, leaving the preview area blank.

## Expected behaviour

On any render failure after the first successful preview, `hideOutputImages` should be reset to `false` so the last known server-side output images are shown while the error state is surfaced via `lastError`.

## Notes

- The initial activation guard (`isActive` requires a prior server execution, and `isGLSLNode` gates the `hideOutputImages` toggle) is correct and not the issue here.
- The gap is purely in the **re-render path**: persistent failures after the first success.

## References

- PR introducing the feature: #10349
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10349#discussion_r2968367333
- Requested by: @jtydhr88

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10354-useGLSLPreview-restore-hideOutputImages-on-shader-re-render-failure-32a6d73d365081c6957bd2409083bea5) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.