Skip to content
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

Moving model to GPU (Infinite loading) #2343

Closed
LennardNimmo opened this issue Feb 23, 2024 · 2 comments
Closed

Moving model to GPU (Infinite loading) #2343

LennardNimmo opened this issue Feb 23, 2024 · 2 comments
Labels
question Further information is requested

Comments

@LennardNimmo
Copy link

I have been using Fooocus for a couple of weeks now. It has worked perfectly this entire time. Moving models to GPU took a minute. But for some reason, since yesterday, moving models to GPU takes 10-15 minutes. And since today it takes an infinite amount of time (or at least longer than an hour).

I have tried the following things, and they don't fix the problem:

  • Full reinstall of Fooocus
  • Full reinstall of all models
  • Updated drivers
  • Tried all kinds of different settings within Fooocus

FULL CONSOLE LOG:
C:\Users\lenna\Documents\Fooocus_win64_2-1-831>.\python_embeded\python.exe -s Fooocus\entry_with_update.py
Already up-to-date
Update succeeded.
[System ARGV] ['Fooocus\entry_with_update.py']
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Fooocus version: 2.1.865
Running on local URL: http://127.0.0.1:7865

To create a public link, set share=True in launch().
Total VRAM 6144 MB, total RAM 16310 MB
Set vram state to: NORMAL_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce GTX 1660 : native
VAE dtype: torch.float32
Using pytorch cross attention
Refiner unloaded.
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids', 'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale'}
Base model loaded: C:\Users\lenna\Documents\Fooocus_win64_2-1-831\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors
Request to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1], ['None', 1.0], ['None', 1.0], ['None', 1.0], ['None', 1.0]] for model [C:\Users\lenna\Documents\Fooocus_win64_2-1-831\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors].
Loaded LoRA [C:\Users\lenna\Documents\Fooocus_win64_2-1-831\Fooocus\models\loras\sd_xl_offset_example-lora_1.0.safetensors] for UNet [C:\Users\lenna\Documents\Fooocus_win64_2-1-831\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
Fooocus Expansion engine loaded for cpu, use_fp16 = False.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
App started successful. Use the app with http://127.0.0.1:7865/ or 127.0.0.1:7865
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 4.0
[Parameters] Seed = 6263587116151614793
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] a man holding an umbrella, forest, black jeans and blue sweater, vivid colors, cinematic, highly detailed, very strong, enhanced, complex, romantic, delicate, innocent, extremely attractive, intricate, endowed, magical mystical, epic, stunning, inspiring, beautiful, creative, winning, illuminated, amazing, symmetry, perfect, colorful, light shining, great, fine, pure
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] a man holding an umbrella, forest, black jeans and blue sweater, rich detail, cinematic atmosphere, complete background, focus, perfect composition, elegant, highly detailed, sharp,, light shining, vivid colors, aesthetic, innocent, mystical, beautiful, novel, dramatic, ambient, shiny, vibrant, depicted, dynamic, radiant, illuminated, extremely, intricate, fine, complex
[Fooocus] Encoding positive #1 ...
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 22.30 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model

@mashb1t
Copy link
Collaborator

mashb1t commented Feb 23, 2024

One reason why the generation may fail now is that your drive doesn't have sufficient free storage for offloading to swap anymore. Please check if your swap has automatically been moved by Windows to another drive (checkable with the steps shown in the troubleshooting guide)

@mashb1t mashb1t added the question Further information is requested label Feb 23, 2024
@LennardNimmo
Copy link
Author

Thank you so so much!!! Your solution fixed the problem. I am very happy. For some reason, Windows must have changed the disk for the swap. Now it only takes a minute to move models to GPU again. Thanks again!

@mashb1t mashb1t closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants