Comfy-Org / Comfy-Org/ComfyUI

[Suggestion] Can provide tip to try for fixing this error in ui - RuntimeWarning: invalid value encountered in cast img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))

Open
#9,265 1 comment 3 reactions 0 assignees View on GitHub
bug-cop:non-blocking Feature
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

This is the error i got today when i was using brand new model released which is "qwen-image" model. This model does not like sage attention but as a linux user i had created alias to run comfyui through cli with sage attention flag by default, so because of this i got this error :

> RuntimeWarning: invalid value encountered in cast
> img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))

I researched in reddit forums and found that people in past had same issue with different models when used with sage attention, so i fixed the issue by not running it with sage attention flag just like others did in past, but i think it will be better to give tip below this error message to guide people to not use sage attention, then restart the comfyui and try again. This will save hours of many people who are not good at finding and testing different thing to find solution for such problems.

Thank you very much comfy team for this great open source project.

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.