ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Error load checkpoint

Open jarilo opened this issue 2 years ago • 19 comments

Expected Behavior

Started generating a demo image.

Actual Behavior

flux_dev_checkpoint_example

Steps to Reproduce

Clicked on Queue Prompt after 1 second a message pops up saying disconnected

Debug Logs

# ComfyUI Error Report
## Error Details
- **Node Type:** CheckpointLoaderSimple
- **Exception Type:** torch.OutOfMemoryError
- **Exception Message:** Allocation on device 
## Stack Trace

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\nodes.py", line 540, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 555, in load_checkpoint_guess_config
    out = load_state_dict_guess_config(sd, output_vae, output_clip, output_clipvision, embedding_directory, output_model, model_options, te_model_options=te_model_options)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 596, in load_state_dict_guess_config
    model = model_config.get_model(sd, diffusion_model_prefix, device=inital_load_device)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\supported_models.py", line 651, in get_model
    out = model_base.Flux(self, device=device)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 704, in __init__
    super().__init__(model_config, model_type, device=device, unet_model=comfy.ldm.flux.model.Flux)

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 102, in __init__
    self.diffusion_model = unet_model(**unet_config, device=device, operations=operations)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\model.py", line 67, in __init__
    [

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\model.py", line 68, in <listcomp>
    DoubleStreamBlock(

  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\layers.py", line 131, in __init__
    operations.Linear(mlp_hidden_dim, hidden_size, bias=True, dtype=dtype, device=device),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Program Files\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\linear.py", line 99, in __init__
    self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System Information

  • ComfyUI Version: v0.2.2-90-g2c641e6
  • Arguments: ComfyUI\main.py --windows-standalone-build --highvram
  • OS: nt
  • Python Version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
  • Embedded Python: true
  • PyTorch Version: 2.4.1+cu124

Devices

  • Name: cuda:0 NVIDIA GeForce RTX 4060 Ti : cudaMallocAsync
    • Type: cuda
    • VRAM Total: 17175019520
    • VRAM Free: 15812536064
    • Torch VRAM Total: 4596957184
    • Torch VRAM Free: 4457506560

Logs

2024-10-06 23:30:21,705 - root - INFO - Total VRAM 16379 MB, total RAM 32704 MB
2024-10-06 23:30:21,705 - root - INFO - pytorch version: 2.4.1+cu124
2024-10-06 23:30:21,705 - root - INFO - Set vram state to: HIGH_VRAM
2024-10-06 23:30:21,705 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 4060 Ti : cudaMallocAsync
2024-10-06 23:30:22,612 - root - INFO - Using pytorch cross attention
2024-10-06 23:30:24,284 - root - INFO - [Prompt Server] web root: c:\Program Files\ComfyUI_windows_portable\ComfyUI\web
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path checkpoints c:\Program Files\Git\stable-diffusion-webui\models/Stable-diffusion
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path configs c:\Program Files\Git\stable-diffusion-webui\models/Stable-diffusion
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path vae c:\Program Files\Git\stable-diffusion-webui\models/VAE
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path loras c:\Program Files\Git\stable-diffusion-webui\models/Lora
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path loras c:\Program Files\Git\stable-diffusion-webui\models/LyCORIS
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path upscale_models c:\Program Files\Git\stable-diffusion-webui\models/ESRGAN
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path upscale_models c:\Program Files\Git\stable-diffusion-webui\models/RealESRGAN
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path upscale_models c:\Program Files\Git\stable-diffusion-webui\models/SwinIR
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path embeddings c:\Program Files\Git\stable-diffusion-webui\embeddings
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path hypernetworks c:\Program Files\Git\stable-diffusion-webui\models/hypernetworks
2024-10-06 23:30:24,284 - root - INFO - Adding extra search path controlnet c:\Program Files\Git\stable-diffusion-webui\models/ControlNet
2024-10-06 23:30:24,752 - root - INFO - 
Import times for custom nodes:
2024-10-06 23:30:24,752 - root - INFO -    0.0 seconds: C:\Program Files\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
2024-10-06 23:30:24,752 - root - INFO - 
2024-10-06 23:30:24,768 - root - INFO - Starting server

2024-10-06 23:30:24,768 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-10-06 23:30:50,513 - root - INFO - got prompt
2024-10-06 23:30:50,614 - root - ERROR - !!! Exception during processing !!! Allocation on device 
2024-10-06 23:30:50,618 - root - ERROR - Traceback (most recent call last):
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\nodes.py", line 540, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 555, in load_checkpoint_guess_config
    out = load_state_dict_guess_config(sd, output_vae, output_clip, output_clipvision, embedding_directory, output_model, model_options, te_model_options=te_model_options)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 596, in load_state_dict_guess_config
    model = model_config.get_model(sd, diffusion_model_prefix, device=inital_load_device)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\supported_models.py", line 651, in get_model
    out = model_base.Flux(self, device=device)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 704, in __init__
    super().__init__(model_config, model_type, device=device, unet_model=comfy.ldm.flux.model.Flux)
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 102, in __init__
    self.diffusion_model = unet_model(**unet_config, device=device, operations=operations)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\model.py", line 67, in __init__
    [
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\model.py", line 68, in <listcomp>
    DoubleStreamBlock(
  File "c:\Program Files\ComfyUI_windows_portable\ComfyUI\comfy\ldm\flux\layers.py", line 131, in __init__
    operations.Linear(mlp_hidden_dim, hidden_size, bias=True, dtype=dtype, device=device),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Program Files\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\linear.py", line 99, in __init__
    self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.OutOfMemoryError: Allocation on device 

2024-10-06 23:30:50,619 - root - ERROR - Got an OOM, unloading all loaded models.
2024-10-06 23:30:50,620 - root - INFO - Prompt executed in 0.11 seconds

Attached Workflow

Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":36,"last_link_id":57,"nodes":[{"id":33,"type":"CLIPTextEncode","pos":{"0":390,"1":400},"size":{"0":422.84503173828125,"1":164.31304931640625},"flags":{"collapsed":true},"order":4,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":54,"slot_index":0}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[55],"slot_index":0}],"title":"CLIP Text Encode (Negative Prompt)","properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""],"color":"#322","bgcolor":"#533"},{"id":27,"type":"EmptySD3LatentImage","pos":{"0":471,"1":455},"size":{"0":315,"1":106},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[51],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"EmptySD3LatentImage"},"widgets_values":[1024,1024,1],"color":"#323","bgcolor":"#535"},{"id":35,"type":"FluxGuidance","pos":{"0":576,"1":96},"size":{"0":211.60000610351562,"1":58},"flags":{},"order":5,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":56}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[57],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5]},{"id":8,"type":"VAEDecode","pos":{"0":1151,"1":195},"size":{"0":210,"1":46},"flags":{},"order":7,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":52},{"name":"vae","type":"VAE","link":46}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":34,"type":"Note","pos":{"0":831,"1":501},"size":{"0":282.8617858886719,"1":164.08004760742188},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[],"properties":{"text":""},"widgets_values":["Note that Flux dev and schnell do not have any negative prompt so CFG should be set to 1.0. Setting CFG to 1.0 means the negative prompt is ignored."],"color":"#432","bgcolor":"#653"},{"id":30,"type":"CheckpointLoaderSimple","pos":{"0":48,"1":192},"size":{"0":315,"1":98},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[47],"slot_index":0,"shape":3},{"name":"CLIP","type":"CLIP","links":[45,54],"slot_index":1,"shape":3},{"name":"VAE","type":"VAE","links":[46],"slot_index":2,"shape":3}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["flux1-dev-fp8.safetensors"]},{"id":9,"type":"SaveImage","pos":{"0":1375,"1":194},"size":{"0":985.3012084960938,"1":1060.3828125},"flags":{},"order":8,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"properties":{},"widgets_values":["ComfyUI"]},{"id":6,"type":"CLIPTextEncode","pos":{"0":384,"1":192},"size":{"0":422.84503173828125,"1":164.31304931640625},"flags":{},"order":3,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":45}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[56],"slot_index":0}],"title":"CLIP Text Encode (Positive Prompt)","properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls"],"color":"#232","bgcolor":"#353"},{"id":31,"type":"KSampler","pos":{"0":816,"1":192},"size":{"0":315,"1":262},"flags":{},"order":6,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":47},{"name":"positive","type":"CONDITIONING","link":57},{"name":"negative","type":"CONDITIONING","link":55},{"name":"latent_image","type":"LATENT","link":51}],"outputs":[{"name":"LATENT","type":"LATENT","links":[52],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[281415887825188,"randomize",20,1,"euler","simple",1]}],"links":[[9,8,0,9,0,"IMAGE"],[45,30,1,6,0,"CLIP"],[46,30,2,8,1,"VAE"],[47,30,0,31,0,"MODEL"],[51,27,0,31,3,"LATENT"],[52,31,0,8,0,"LATENT"],[54,30,1,33,0,"CLIP"],[55,33,0,31,2,"CONDITIONING"],[56,6,0,35,0,"CONDITIONING"],[57,35,0,31,1,"CONDITIONING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8264462809917354,"offset":[24.960298715720057,36.39329049419584]}},"version":0.4}

Additional Context

(Please add any additional context or steps to reproduce the error here)



### Other

_No response_

jarilo avatar Oct 06 '24 20:10 jarilo

Don't use --highvram. Even a 4090 is not sufficient to use FLUX in highvram mode.

ltdrdata avatar Oct 07 '24 02:10 ltdrdata

I tried both --normalvram and --lowvram and no parameters, always the same result, the impression is that it does not even try to load, there is an error in the loading procedure. Moreover, if you change the checkpoint from FLUX to any other in the checkpoints, it works fine, but the result will be understandably deplorable. I checked the checksum sha256 FLUX, everything is ok.

jarilo avatar Oct 07 '24 15:10 jarilo

@ltdrdata Could it be a issue caused by the space in folder path? It's inside C:\Program Files\

@jarilo I would try moving ComfyUI_windows_portable in C: and try again. Spaces in folder path is a known issue.

LukeG89 avatar Oct 07 '24 16:10 LukeG89

a space in a path shouldn't cause a cuda out of memory error 0.o

Though also yeah, Program Files is about the worst place to put comfy - in addition to the space in the path, it also has windows security restrictions on edits to the files within that will be problematic for a lot of common usages

mcmonkey4eva avatar Oct 07 '24 16:10 mcmonkey4eva

Moved to the root of the disk. Didn't help. And there are no problems with 20 other checkpoints. Namely, FLUX has already tried 3 versions and doesn't work.

jarilo avatar Oct 07 '24 20:10 jarilo

Should be running without any vram parameters generally to be clear. Default behavior is to auto-adjust based on how much vram is used.

Also make sure you don't eg accidentally have multiple AI programs open at the same time, or a video game or similar - anything that will eat into your total VRAM.

Also if you have custom nodes installed, test removing them.

Your logs report Total VRAM 16379 MB, total RAM 32704 MB so with the FP8 version you should be fine on memory regardless as long as you don't trust to use the vram cli args.

mcmonkey4eva avatar Oct 07 '24 21:10 mcmonkey4eva

I don't understand what the problem is. I decided to reinstall the drivers, although everything worked like clockwork except for this problem. I removed all software related to Nvidia and Cuda Toolkit. I had Game Ready, installed the latest Studio with a clean installation. Nothing changed. Automatic1111 and ComfyUI work with all checkpoints except FLUX. Only if you select FLUX, it immediately disconnects.

jarilo avatar Oct 08 '24 20:10 jarilo

I don't understand what the problem is. I decided to reinstall the drivers, although everything worked like clockwork except for this problem. I removed all software related to Nvidia and Cuda Toolkit. I had Game Ready, installed the latest Studio with a clean installation. Nothing changed. Automatic1111 and ComfyUI work with all checkpoints except FLUX. Only if you select FLUX, it immediately disconnects.

Disconnection occurs when your system forcibly kills processes due to insufficient memory. 32GB is insufficient capacity when using FLUX. Use quantized models for both T5 and FLUX models.

Of course, close all other programs as well to secure as much memory as possible.

ltdrdata avatar Oct 10 '24 04:10 ltdrdata

FLUX full version dev works great on 8 video RAM + 24 RAM system. So on my 16 + 32 it should work like a clock freely. The error is clearly in the loading procedure into memory, and it appears to me because of some individuality in the system.

jarilo avatar Oct 10 '24 15:10 jarilo

FLUX full version dev works great on 8 video RAM + 24 RAM system. So on my 16 + 32 it should work like a clock freely. The error is clearly in the loading procedure into memory, and it appears to me because of some individuality in the system.

The flux dev full version absolutely cannot be loaded on 8GB VRAM, and it also cannot be loaded on 24GB RAM. You're completely misunderstanding something. The flux dev full version requires 24GB just for the diffusion model alone.

ltdrdata avatar Oct 10 '24 16:10 ltdrdata

Maybe or maybe not, don't talk nonsense! It is not necessary to load everything into memory, it is enough to load parts. Not in the course? Here is an article on how to do it. https://3dnews.ru/1110246/praktikum-po-iirisovaniyu-chast-10-flux

jarilo avatar Oct 10 '24 16:10 jarilo

Maybe or maybe not, don't talk nonsense! It is not necessary to load everything into memory, it is enough to load parts. Not in the course? Here is an article on how to do it. https://3dnews.ru/1110246/praktikum-po-iirisovaniyu-chast-10-flux

The version mentioned there running on 8GB is not the full version, but a quantized version. That's the one you need. You should check https://github.com/city96/ComfyUI-GGUF

ltdrdata avatar Oct 10 '24 16:10 ltdrdata

You are inattentive, I already wrote that I used all possible versions. The result is always the same. You didn't even bother to look at the picture of the Fox. In the topic title. https://comfyanonymous.github.io/ComfyUI_examples/flux/#simple-to-use-fp8-checkpoint-version

jarilo avatar Oct 10 '24 23:10 jarilo

You are inattentive, I already wrote that I used all possible versions. The result is always the same. You didn't even bother to look at the picture of the Fox. In the topic title. https://comfyanonymous.github.io/ComfyUI_examples/flux/#simple-to-use-fp8-checkpoint-version

To be honest, I'm confused about what you're saying.

The topic post is talking about flux full (fp8), not fp16, failing to run in a 16GB VRAM environment.

And below, you mention "FLUX full version dev works great on 8 video RAM + 24 RAM system" suggesting it can run on 8GB VRAM.

Even if I assume that the mention of FLUX full likely refers to the fp8 version rather than the fp16 version which would be around 24GB, it's still 11GB. Is it correct to say that it loaded and operated without issues on 8GB VRAM?

ltdrdata avatar Oct 11 '24 04:10 ltdrdata

What's not to understand? This simple technique is over 40 years old and I think every schoolchild knows about it, except you, apparently. If you can't load all the data into memory, then it will be loaded in parts. Of course, if you have the ability to place all the data in RAM, then this will greatly speed up their processing, but in reality, such a scenario practically does not exist.

jarilo avatar Oct 11 '24 15:10 jarilo

What's not to understand? This simple technique is over 40 years old and I think every schoolchild knows about it, except you, apparently. If you can't load all the data into memory, then it will be loaded in parts. Of course, if you have the ability to place all the data in RAM, then this will greatly speed up their processing, but in reality, such a scenario practically does not exist.

If you're talking about partial loading, that's not supported in ComfyUI.

In generative AI, repeatedly moving between disk and RAM won't just cause a slight performance difference, it will result in a hundredfold difference in performance.

Even transferring model data between RAM and VRAM during a single inference causes significant performance degradation, which is why it's not used.

If you simply want to keep part of the model on disk, you can set a sufficiently large swap memory in your OS settings. When using swap memory, if the OS detects insufficient memory, it manages the situation by moving some of the RAM data to disk. At least that prevents the OS from killing ComfyUI due to insufficient memory.

ltdrdata avatar Oct 11 '24 16:10 ltdrdata

If you're talking about partial loading, that's not supported in ComfyUI.

If you read the article I linked to, you would understand that adding the ability to partially load is as easy as pie. And this is not theory, but practice, everything works and in an acceptable time. The execution time is also given there.

jarilo avatar Oct 11 '24 19:10 jarilo

exactly same question with you,it already confuse me two days。cant find a work。

yituo-max avatar Dec 02 '24 10:12 yituo-max

If --lowvram is still insufficient, there is a last-resort option: --novram.

ltdrdata avatar Dec 02 '24 13:12 ltdrdata