ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

ComfyUI crashes when using FLUX based models

Open RagingFlames opened this issue 1 year ago • 1 comments

Your question

I'm want to try out FLUX1-D and am running into problems basically right off the bat. I've loaded this preset and have filled in the values with the files I downloaded. image However when I try and queue, comfyUI just stops and doesn't give any useful errors. I found this issue that shows a similar problem, but I have 140 GB of disk free on my C drive (The disk with comfyUI on it). Am I missing something here, why isn't this working?

Logs

C:\Users\RagingFlames\Documents\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-08-25 16:57:39.926229
** Platform: Windows
** Python version: 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
** Python executable: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\python_embeded\python.exe
** ComfyUI Path: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI
** Log path: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes:
   1.0 seconds: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 24576 MB, total RAM 49062 MB
pytorch version: 2.3.1+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\web
### Loading: ComfyUI-Manager (V2.50.2)
### ComfyUI Revision: 2610 [7df42b9a] *DETACHED | Released on '2024-08-23'
Traceback (most recent call last):
  File "C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1993, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui\__init__.py", line 1, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 17, in <module>
    from .xflux.src.flux.util import (configs, load_ae, load_clip,
  File "C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui\xflux\src\flux\util.py", line 6, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

Cannot import C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui module for custom nodes: No module named 'cv2'

Import times for custom nodes:
   0.0 seconds: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
   0.0 seconds (IMPORT FAILED): C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui
   0.3 seconds: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Starting server

To see the GUI go to: http://127.0.0.1:8188
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
FETCH DATA from: C:\Users\RagingFlames\Documents\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]
got prompt
Using pytorch attention in VAE
Using pytorch attention in VAE

C:\Users\RagingFlames\Documents\ComfyUI_windows_portable>pause
Press any key to continue . . .

Other

I am hoping to avoid maxing out my houses bandwidth for hours to redownload the model, so here are the hashes I have incase someone thinks that's it. flux1-dev.safetensors SHA256: 4610115bb0c89560703c892c59ac2742fa821e60ef5871b33493ba544683abd7 clip_l.safetensors SHA256: 660c6f5b1abae9dc498ac2d21e1347d2abdb0cf6c0c0c8576cd796491d9a6cdd t5xxl_fp8_e4m3fn.safetensors SHA256: 7d330da4816157540d6bb7838bf63a0f02f573fc48ca4d8de34bb0cbfd514f09

I'm honestly not sure what the CV2 error is about or if it's related. I've been able to run other models that aren't FLUX just fine. When I use the ComfyUI manager and choose update all I get this error image

Also not sure if related.

RagingFlames avatar Aug 25 '24 21:08 RagingFlames

just posted on issue #4258, for me its working if i change the dtype. https://github.com/comfyanonymous/ComfyUI/issues/4258#issuecomment-2309043446

maybe try setting it to something else instead of "default"

Skiddoh avatar Aug 25 '24 23:08 Skiddoh

just posted on issue #4258, for me its working if i change the dtype. #4258 (comment)

maybe try setting it to something else instead of "default"

Yeah that solved it for me. I'm going to close this issue in favor of the older one then. Hopefully some better error reporting gets added.

RagingFlames avatar Aug 26 '24 15:08 RagingFlames