lllyasviel / Fooocus

Focus on prompting and generating
GNU General Public License v3.0
41.02k stars 5.76k forks source link

Can't load models from subfolders #2163

Closed wknx closed 8 months ago

wknx commented 8 months ago

Hi! Even though I have correctly configured the config.txt, Fooocus doesn't show any models that are inside subfolders.

All my Checkpoints and LoRa models are located inside A1111 at "C:\StableDiff\A1111\stable-diffusion-webui\models\Stable-diffusion"

And here is the content of my config.txt:

{
    "path_checkpoints": "C:\\StableDiff\\A1111\\stable-diffusion-webui\\models\\Stable-diffusion",
    "path_loras": "C:\\StableDiff\\A1111\\stable-diffusion-webui\\models\\Lora",
    "path_embeddings": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\embeddings",
    "path_vae_approx": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\vae_approx",
    "path_upscale_models": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\upscale_models",
    "path_inpaint": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\inpaint",
    "path_controlnet": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\controlnet",
    "path_clip_vision": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\clip_vision",
    "path_fooocus_expansion": "C:\\StableDiff\\Fooocus\\Fooocus\\models\\prompt_expansion\\fooocus_expansion",
    "path_outputs": "C:\\StableDiff\\Fooocus\\Fooocus\\outputs"
}
wknx commented 8 months ago

So, testing further I've just realized that Fooocus do load models from subfolders, just not the 'default ones'. These NEED to be located at the root folder specified at config.txt or else it tries to download them again at startup.

default files:

animaPencilXL_v100.safetensors
juggernautXL_v8Rundiffusion.safetensors
realisticStockPhoto_v20.safetensors
SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4

I think it would be nice if at startup, before the download attempt, Fooocus could scan the subdirectories specified at config.txt in search for the default models.

mashb1t commented 8 months ago

Thank you for your feedback. This is the expected behavior. I suggest to change the default models in the presets to include the relative path of the model on your filesystem.