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

[Feature request] Propose a shared model location #8

Closed
tcmaps opened this issue Aug 12, 2023 · 7 comments
Closed

[Feature request] Propose a shared model location #8

tcmaps opened this issue Aug 12, 2023 · 7 comments

Comments

@tcmaps
Copy link
Contributor

tcmaps commented Aug 12, 2023

There are so many SD-webuis now and each is saving the models inside it's own directory structure. Novice users unbeknownst of symlinking or launch parameter will divert to upgrading their drives, uneedingly wasting resources.

Someone should take the lead and define a default location in AppData/Local on Windows or the user's home directory on *nix. HF diffusers is a positive example with using a system-wide cache.

@WinstonWoof
Copy link

Noooooo, I dont want anything being written to my "normal" windows folders. I want all of the installs to be standalone.

What would be useful though is if maintainers put instructions on how to create symlinks etc as part of the install (although thats a sperate issue , so many 12 o'colck flashers dont read any of the documentation as it is!!

@ke1ne
Copy link

ke1ne commented Aug 13, 2023

@lllyasviel I would propose to:

  1. make downloading of models optional instead of forced;
  2. add settings page so user can set paths to existing model directories.

@jlitz
Copy link

jlitz commented Aug 13, 2023

yea doesn't make sense to d/l the models again should be optionable or have a setting to point to stored models.

@teadrinker
Copy link

Please support configurable paths similar to ComfyUI:

https://github.com/comfyanonymous/ComfyUI/blob/master/extra_model_paths.yaml.example

@uarefans
Copy link

uarefans commented Aug 20, 2023

Notes: Just work for me, i don't know if this code break author code, just want share

  1. create config.json in same folder with readme.md (change C:\Users\new\AI_Model with your model folder )
    {
        "modelfile_path": "C:\\Users\\new\\AI_Model\\checkpoints",
        "lorafile_path": "C:\\Users\\new\\AI_Model\\loras",
        "temp_outputs_path": "C:\\Users\\new\\AI_Fooocus\\Fooocus\\outputs"
    }
  2. edit Fooocus\modules\path.py
import os
import json

# Load configuration from config.json
with open(os.path.abspath(os.path.join(os.path.dirname(__file__), '../config.json')), 'r') as config_file:
    config = json.load(config_file)

# Access configuration values
modelfile_path = config["modelfile_path"]
lorafile_path = config["lorafile_path"]
temp_outputs_path = config["temp_outputs_path"]

# Delete or comment this 3 lines
#modelfile_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../models/checkpoints/'))
#lorafile_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../models/loras/'))
#temp_outputs_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../outputs/'))

# ... existing code

@eypacha
Copy link

eypacha commented Aug 26, 2023

@uarefans This simple code is a good idea for a pull quest, I would only add some conditionals (to not download models on first run if custom folders are declared) and and Try Except for handle it. What do you think? I am not saying that you should do it, in a few days if I have free time I can write it.

@mashb1t
Copy link
Collaborator

mashb1t commented Dec 29, 2023

This is all now possible by using presets and the config.txt. Closing this issue.

@mashb1t mashb1t closed this as completed Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants