-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to run with Image Prompt Using 6GB memory. #700
Comments
Show full logs. I know that 3060 6G works. Some 2060 does not support float16 so it may be different |
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] To create a public link, set During handling of the above exception, another exception occurred: Traceback (most recent call last): |
does text-to-image without image prompt work?
|
text-to-image without image prompt work well. |
I also added https://github.com/lllyasviel/Fooocus/releases/tag/release it can patch and change your env to CUDA 11.8 and Pytorch2.0 with an old version of xformers. I do not think users really need it but if it works then I will change my mind |
To add --use-split-cross-attention or --use-quad-cross-attention didnot work. |
I have test previous_old_xformers_env.7z and it produces the same result. |
Besides, I have try the same folders with other GPU -- RTX3080 12G, it works all well in the same env and the same Fooocus. |
I have the same problem on my GTX 1060 6GB graphics card. When I use the Image prompt with PyraCanny and the image processing reaches 100%, I get an out-of-memory error during VAE decoding, and the image doesn't save. My PC config is :- Graphics Driver version is 531.18, as mentioned in the main repo page Error: [Fooocus Model Management] Moving model(s) has taken 7.65 seconds During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
I have tested SDXL in comfyui with RTX2060 6G, when I use clip_vison, it works well too. So the problem may come from comfyui's nodes. |
in fooocus you should also see "Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding" and then get the image? |
in fooocus I got the same " Warning: Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding" and then I did not get any image. |
any log? this is different from your previous report i think |
ah i see the warning in log - will take a look |
This the log of comfyui when using "sai_xl_canny_128lora.safetensors" : Now the UI folder is E:\Z_comfyui_2023-10-17 Prestartup times for custom nodes: Total VRAM 6144 MB, total RAM 32489 MB Loading: ComfyUI-Manager (V0.30.3)ComfyUI Revision: 1479 [f8032cdf]Registered sys.path: ['E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\init.py', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_pycocotools', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_oneformer', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_mmpkg', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_midas_repo', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_detectron2', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\controlnet_aux', 'E:\Z_comfyui_2023-10-17\ComfyUI\custom_nodes\comfyui_controlnet_aux\src', 'E:\Z_comfyui_2023-10-17\ComfyUI\comfy', 'E:\Z_comfyui_2023-10-17\python_embeded\lib\site-packages\git\ext\gitdb', 'E:\Z_comfyui_2023-10-17\ComfyUI', 'E:\Z_comfyui_2023-10-17\python_embeded\python310.zip', 'E:\Z_comfyui_2023-10-17\python_embeded\DLLs', 'E:\Z_comfyui_2023-10-17\python_embeded\lib', 'E:\Z_comfyui_2023-10-17\python_embeded', 'E:\Z_comfyui_2023-10-17\python_embeded\lib\site-packages', 'E:\Z_comfyui_2023-10-17\python_embeded\lib\site-packages\win32', 'E:\Z_comfyui_2023-10-17\python_embeded\lib\site-packages\win32\lib', 'E:\Z_comfyui_2023-10-17\python_embeded\lib\site-packages\Pythonwin', '../..']
Import times for custom nodes: Setting output directory to: E:\Z_comfyui_2023-10-17\output To see the GUI go to: http://0.0.0.0:8188 During handling of the above exception, another exception occurred: Traceback (most recent call last): Prompt executed in 203.19 seconds |
and in comfyui user interface , it show the error: Error occurred when executing VAEDecode: Allocation on device 0 would exceed allowed memory. (out of memory) File "E:\Z_comfyui_2023-10-17\ComfyUI\execution.py", line 152, in recursive_execute |
so do you get image from comfyui? |
no image in comfyui |
interesting. |
working on it |
try 2.1.695 see if fixed |
It works all well now ! |
hi @youyegit Fooocus 2.1.700 used another method. feel free to try again ane let us know if it works |
I try Fooocus 2.1.703 and it works well. |
When running with Image Prompt, to generate the preview images always uses less than 4GB, but VAE decoding shows "ran out of memory".
Is it possible to do some optimization or to use the share memory just like ComfyUI?
Thanks the great job and hope Fooocus will be better.
below is the running log ( using RTX 2060 6G ) :
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 7.0
[Fooocus] Downloading control models ...
[Fooocus] Loading control models ...
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 20
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.78 seconds
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] New suffix: extremely clean, polished, artstation trend, human is depicted as a tree with apples or oranges, clean strokes
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] New suffix: intricate, elegant, volumetric lighting, digital painting, highly detailed, artstation, sharp focus, illustration, concept art, ruan jia, steve mccurry
[Fooocus] Encoding positive #1 ...
[Fooocus Model Management] Moving model(s) has taken 0.13 seconds
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Fooocus] Image processing ...
Requested to load CLIPVisionModelWithProjection
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 1.01 seconds
Requested to load Resampler
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.56 seconds
Requested to load To_KV
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.24 seconds
Preparation time: 4.19 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.02916753850877285, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
loading in lowvram mode 2750.0320749282837
[Fooocus Model Management] Moving model(s) has taken 9.90 seconds
[Sampler] Fooocus sampler is activated.
3%|██▊ | 1/30 [00:02<01:19, 2.75s/i 7%|█████▌ | 2/30 [00:05<01:17, 2.78 10%|████████▎ | 3/30 [00:08<01:15, 2 13%|███████████ | 4/30 [00:11<01:12, 17%|█████████████▊ | 5/30 [00:13<01:0 20%|████████████████▌ | 6/30 [00:16<0 23%|███████████████████▎ | 7/30 [00:1 27%|██████████████████████▏ | 8/30 [0 30%|████████████████████████▉ | 9/30 33%|███████████████████████████▎ | 10/ 37%|██████████████████████████████ | 1 40%|████████████████████████████████▊ 43%|███████████████████████████████████▌ 47%|██████████████████████████████████████▎ 50%|█████████████████████████████████████████ 53%|███████████████████████████████████████████▋ 57%|██████████████████████████████████████████████▍ 60%|█████████████████████████████████████████████████▏ 63%|███████████████████████████████████████████████████▉ 67%|██████████████████████████████████████████████████████▋ 70%|█████████████████████████████████████████████████████████ 73%|█████████████████████████████████████████████████████████ 77%|█████████████████████████████████████████████████████████ 80%|█████████████████████████████████████████████████████████ 83%|█████████████████████████████████████████████████████████ 87%|█████████████████████████████████████████████████████████ 90%|█████████████████████████████████████████████████████████ 93%|█████████████████████████████████████████████████████████ 97%|█████████████████████████████████████████████████████████ 100%|█████████████████████████████████████████████████████████ 100%|█████████████████████████████████████████████████████████ █████████████████████████| 30/30 [01:15<00:00, 2.52s/it]
Warning: Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding.
Traceback (most recent call last):
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\sd.py", line 205, in decode
pixel_samples[x:x+batch_number] = torch.clamp((self.first_stage_model.decode(samples).cpu().float() + 1.0) / 2.0, min=0.0, max=1.0)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\ldm\models\autoencoder.py", line 94, in decode
dec = self.decoder(z)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\ldm\modules\diffusionmodules\model.py", line 713, in forward
h = self.up[i_level].upsample(h)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\ldm\modules\diffusionmodules\model.py", line 71, in forward
x = self.conv(x)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 968.00 MiB (GPU 0; 6.00 GiB total capacity; 4.28 GiB already allocated; 118.80 MiB free; 4.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\AI\Z_fc_2023-10-15\Fooocus\modules\async_worker.py", line 576, in worker
handler(task)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\modules\async_worker.py", line 509, in handler
imgs = pipeline.process_diffusion(
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\modules\default_pipeline.py", line 371, in process_diffusion
decoded_latent = core.decode_vae(vae=final_vae, latent_image=sampled_latent, tiled=tiled)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\modules\core.py", line 118, in decode_vae
return opVAEDecode.decode(samples=latent_image, vae=vae)[0]
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\nodes.py", line 267, in decode
return (vae.decode(samples["samples"]), )
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\sd.py", line 208, in decode
pixel_samples = self.decode_tiled_(samples_in)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\sd.py", line 175, in decode_tiled_
fcbh.utils.tiled_scale(samples, decode_fn, tile_x * 2, tile_y // 2, overlap, upscale_amount = 8, pbar = pbar) +
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\utils.py", line 395, in tiled_scale
ps = function(s_in).cpu()
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\sd.py", line 172, in
decode_fn = lambda a: (self.first_stage_model.decode(a.to(self.vae_dtype).to(self.device)) + 1.0).float()
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\ldm\models\autoencoder.py", line 94, in decode
dec = self.decoder(z)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\ldm\modules\diffusionmodules\model.py", line 713, in forward
h = self.up[i_level].upsample(h)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\Fooocus\backend\headless\fcbh\ldm\modules\diffusionmodules\model.py", line 71, in forward
x = self.conv(x)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "C:\AI\Z_fc_2023-10-15\python_embeded\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 256.00 MiB (GPU 0; 6.00 GiB total capacity; 4.59 GiB already allocated; 0 bytes free; 5.14 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Total time: 96.47 seconds
The text was updated successfully, but these errors were encountered: