Skip to content

Commit

Permalink
Merge pull request #13 from jb55/fix-patch-again
Browse files Browse the repository at this point in the history
fixup! webui.patch without extra whitespaces
  • Loading branch information
gbtb authored Nov 29, 2022
2 parents d3beaef + 1524c93 commit c7295a5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@
''
cd stable-diffusion-webui
git reset --hard HEAD
git config core.whitespace cr-at-eol
git apply ${./webui.patch}
git apply ${./webui.patch}
rm -rf repositories/
mkdir repositories
ln -s ${inputs.stable-diffusion-repo}/ repositories/stable-diffusion
Expand Down
72 changes: 36 additions & 36 deletions webui.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,47 @@ index 8affd41..394436e 100644
--- a/launch.py
+++ b/launch.py
@@ -176,16 +176,16 @@ 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)

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)
diff --git a/modules/paths.py b/modules/paths.py
index 1e7a2fb..1298c58 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 = {}

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 = {}
--
2.38.1

0 comments on commit c7295a5

Please sign in to comment.