ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Using the sage attn parameter at startup will cause qwen image to generate a black image

Open Wenaka2004 opened this issue 1 year ago • 21 comments

Custom Node Testing

Expected Behavior

generate image

Actual Behavior

generate black image

Image

Steps to Reproduce

Image use sage attn arrg when lunch use this image as workflow

Debug Logs

no err

Other

No response

Wenaka2004 avatar Aug 05 '25 08:08 Wenaka2004

蹲

shaozheng0503 avatar Aug 05 '25 10:08 shaozheng0503

Do not use e4m3n_fast for Unet, the result will be good~!

niaoyu123 avatar Aug 05 '25 10:08 niaoyu123

I had the same problem and a patch sage attention node after your model loader is what fixed for me

Image

DevNvll avatar Aug 05 '25 15:08 DevNvll

I had the same problem and a patch sage attention node after your model loader is what fixed for me Image

didn't fix it for me. i had to remove --fast and --using-sageattention from the launch bat for it to work

rktvr avatar Aug 05 '25 15:08 rktvr

I had the same problem and a patch sage attention node after your model loader is what fixed for me我也有同样的问题,在模型加载器之后添加一个 sage attention 节点修复了我的问题

Image

添加后是这样的问题

Image

leihaolei avatar Aug 06 '25 02:08 leihaolei

Still same no matter what.

CHKE9 avatar Aug 06 '25 05:08 CHKE9

I figured out that in my case, black images were caused by using brackets in the prompt for some reason. If I remove the brackets, the images generate normally. I have AMD GPU (7800XT) on linux.

Donkeehot avatar Aug 06 '25 05:08 Donkeehot

I figured out that in my case, black images were caused by using brackets in the prompt for some reason. If I remove the brackets, the images generate normally. I have AMD GPU (7800XT) on linux.

On MacBook Pro M4 removing brackets from the prompt also solved the black output issue. Thanks!

szabodanika avatar Aug 06 '25 11:08 szabodanika

I solved it by change version of sageattn to 2.0.1

Wenaka2004 avatar Aug 06 '25 12:08 Wenaka2004

sageattention 2.1.1+cu128torch2.7.0 also gives black image

kanarch66 avatar Aug 07 '25 08:08 kanarch66

I turned off SageAttention and it's working properly now.

leihaolei avatar Aug 07 '25 08:08 leihaolei

why is this closed? it still doesn't work with sage attn 2.2, I shouldn't need to disable it just to get it working.

phazei avatar Aug 10 '25 08:08 phazei

It doesn't work even without sage_attention. Only now it's not a black screen, but colored pixels. Image

KLL535 avatar Aug 10 '25 22:08 KLL535

This might be useful to anyone following this issue: https://github.com/comfyanonymous/ComfyUI/issues/9077#issuecomment-3173454804

phazei avatar Aug 11 '25 06:08 phazei

Bad keys for QWEN: --use-sage-attention - create black image --fast - create broken colored pixels (I don't know what this key does)

Work keys for QWEN: .\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --front-end-version Comfy-Org/ComfyUI_frontend@latest

KLL535 avatar Aug 13 '25 18:08 KLL535

Any solution for this?

monstari avatar Aug 24 '25 08:08 monstari

Using Patch Sage Attention KJ with "sageattn_qk_int8_pv_fp16_cuda" option fixes the problem for me.

sinand99 avatar Aug 25 '25 16:08 sinand99

Using Patch Sage Attention KJ with "sageattn_qk_int8_pv_fp16_cuda" option fixes the problem for me.

30 Series video card. This does not work for me ......

Pythonpa avatar Sep 04 '25 14:09 Pythonpa

Using Patch Sage Attention KJ with "sageattn_qk_int8_pv_fp16_cuda" option fixes the problem for me.

So Triton is the issue. For me, savings (with this model) are so marginal without Triton that it doesn't seem worth using SageAttention at all.

ljredux avatar Oct 25 '25 10:10 ljredux

go to ComfyUI/venv/lib/python3.10/site-packages/sageattention/core.py go to line 118 replace with this arch = get_cuda_arch_versions()[q.device.index] if arch in ("sm80", "sm86"): return sageattn_qk_int8_pv_fp16_cuda(q, k, v, tensor_layout=tensor_layout, is_causal=is_causal, sm_scale=sm_scale, return_lse=return_lse, pv_accum_dtype="fp32") # elif arch == "sm86": # return sageattn_qk_int8_pv_fp16_triton(q, k, v, tensor_layout=tensor_layout, is_causal=is_causal, sm_scale=sm_scale, return_lse=return_lse) elif arch == "sm89":

jandan520 avatar Mar 10 '26 20:03 jandan520