ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

ComfyUI is not deterministic

Open asd417 opened this issue 2 years ago • 8 comments

ComfyUI_00180_ ComfyUI_00182_ ComfyUI_00183_

All these images are generated with exact same seed and node structure. I believe that the images above maintain their exif data but here is the node structure: Capture You can see that the two seed inputs are linked together. the ui does not even let me generate this twice in a row because it's the same prompt. I think it's a bit of a problem for this to be not deterministic. Will this issue be fixed?

asd417 avatar Apr 03 '23 13:04 asd417

Yeah that's an issue I need to fix.

comfyanonymous avatar Apr 03 '23 17:04 comfyanonymous

didja fix it?

wyrde avatar Apr 04 '23 03:04 wyrde

It's an xformers problem. Xformers optimizations make the generations undeterministic, hence why I stopped using it in auto webui long ago. Haven't looked into it but there should be a way to disable xformers if there's none.

jexom avatar Apr 12 '23 12:04 jexom

To [mostly] address this issue, one can run ComfyUI with

python main.py --use-pytorch-cross-attention

This should disable Xformers and allow for repeatiblity across generations

ill13 avatar Dec 16 '23 16:12 ill13

xformers is deterministic as of 0.0.19. https://github.com/facebookresearch/xformers/releases/tag/v0.0.19

catboxanon avatar Dec 16 '23 16:12 catboxanon

Good to know! Maybe I'm complelety offbase with the Xformers stuff?

Either way, until I used the above command all of my generations with ComfyUI were unrepeatable and random - directly after starting ComfyUI with --use-pytorch-cross-attention changing seeds back and forth generated what looks to be the same image.

ill13 avatar Dec 16 '23 17:12 ill13