mirror of
https://github.com/gbtb/nix-stable-diffusion.git
synced 2024-09-11 11:16:15 +03:00
extracted patch for webui into a file
This commit is contained in:
parent
cefff56221
commit
399287becf
@ -226,6 +226,7 @@
|
||||
shellHook = ''
|
||||
cd stable-diffusion-webui
|
||||
git reset --hard HEAD
|
||||
git apply ${./webui.patch}
|
||||
rm -rf repositories/
|
||||
mkdir repositories
|
||||
ln -s ${inputs.stable-diffusion-repo}/ repositories/stable-diffusion
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 956c3b15449096475e927d7bf07e3315a4b4eba5
|
||||
Subproject commit 7f8ab1ee8f304031b3404e25761dd0f4c7be7df8
|
78
webui.patch
Normal file
78
webui.patch
Normal file
@ -0,0 +1,78 @@
|
||||
diff --git a/launch.py b/launch.py
|
||||
index 333f308..6c13cca 100644
|
||||
--- a/launch.py
|
||||
+++ b/launch.py
|
||||
@@ -86,7 +86,7 @@ def git_clone(url, dir, name, commithash=None):
|
||||
if commithash is not None:
|
||||
run(f'"{git}" -C {dir} checkout {commithash}', None, "Couldn't checkout {name}'s hash: {commithash}")
|
||||
|
||||
-
|
||||
+
|
||||
def version_check(commit):
|
||||
try:
|
||||
import requests
|
||||
@@ -103,7 +103,7 @@ def version_check(commit):
|
||||
except Exception as e:
|
||||
print("versipm check failed",e)
|
||||
|
||||
-
|
||||
+
|
||||
def prepare_enviroment():
|
||||
torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113")
|
||||
requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
|
||||
@@ -143,7 +143,7 @@ def prepare_enviroment():
|
||||
|
||||
print(f"Python {sys.version}")
|
||||
print(f"Commit hash: {commit}")
|
||||
-
|
||||
+
|
||||
if not is_installed("torch") or not is_installed("torchvision"):
|
||||
run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
|
||||
|
||||
@@ -176,20 +176,20 @@ def prepare_enviroment():
|
||||
|
||||
os.makedirs(dir_repos, exist_ok=True)
|
||||
|
||||
- git_clone(stable_diffusion_repo, repo_dir('stable-diffusion'), "Stable Diffusion", stable_diffusion_commit_hash)
|
||||
- git_clone(taming_transformers_repo, repo_dir('taming-transformers'), "Taming Transformers", taming_transformers_commit_hash)
|
||||
- git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash)
|
||||
- git_clone(codeformer_repo, repo_dir('CodeFormer'), "CodeFormer", codeformer_commit_hash)
|
||||
- git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash)
|
||||
+ #git_clone(stable_diffusion_repo, repo_dir('stable-diffusion'), "Stable Diffusion", stable_diffusion_commit_hash)
|
||||
+ #git_clone(taming_transformers_repo, repo_dir('taming-transformers'), "Taming Transformers", taming_transformers_commit_hash)
|
||||
+ #git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash)
|
||||
+ #git_clone(codeformer_repo, repo_dir('CodeFormer'), "CodeFormer", codeformer_commit_hash)
|
||||
+ #git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash)
|
||||
|
||||
if not is_installed("lpips"):
|
||||
run_pip(f"install -r {os.path.join(repo_dir('CodeFormer'), 'requirements.txt')}", "requirements for CodeFormer")
|
||||
|
||||
- run_pip(f"install -r {requirements_file}", "requirements for Web UI")
|
||||
+ #run_pip(f"install -r {requirements_file}", "requirements for Web UI")
|
||||
|
||||
if update_check:
|
||||
version_check(commit)
|
||||
-
|
||||
+
|
||||
if "--exit" in sys.argv:
|
||||
print("Exiting because of --exit argument")
|
||||
exit(0)
|
||||
diff --git a/modules/paths.py b/modules/paths.py
|
||||
index 1e7a2fb..eefa44d 100644
|
||||
--- a/modules/paths.py
|
||||
+++ b/modules/paths.py
|
||||
@@ -19,10 +19,10 @@ assert sd_path is not None, "Couldn't find Stable Diffusion in any of: " + str(p
|
||||
|
||||
path_dirs = [
|
||||
(sd_path, 'ldm', 'Stable Diffusion', []),
|
||||
- (os.path.join(sd_path, '../taming-transformers'), 'taming', 'Taming Transformers', []),
|
||||
- (os.path.join(sd_path, '../CodeFormer'), 'inference_codeformer.py', 'CodeFormer', []),
|
||||
- (os.path.join(sd_path, '../BLIP'), 'models/blip.py', 'BLIP', []),
|
||||
- (os.path.join(sd_path, '../k-diffusion'), 'k_diffusion/sampling.py', 'k_diffusion', ["atstart"]),
|
||||
+ ('@taming_transformers@', 'taming', 'Taming Transformers', []),
|
||||
+ ('@codeformer@', 'inference_codeformer.py', 'CodeFormer', []),
|
||||
+ ('@blip@', 'models/blip.py', 'BLIP', []),
|
||||
+ ('@k_diffusion@', 'k_diffusion/sampling.py', 'k_diffusion', ["atstart"]),
|
||||
]
|
||||
|
||||
paths = {}
|
Loading…
Reference in New Issue
Block a user