Skip to content

Commit 2f90496

Browse files
authored
Merge branch 'master' into cors-regex
2 parents a258fd6 + 47a44c7 commit 2f90496

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+723
-7666
lines changed

javascript/generationParams.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// attaches listeners to the txt2img and img2img galleries to update displayed generation param text when the image changes
2+
3+
let txt2img_gallery, img2img_gallery, modal = undefined;
4+
onUiUpdate(function(){
5+
if (!txt2img_gallery) {
6+
txt2img_gallery = attachGalleryListeners("txt2img")
7+
}
8+
if (!img2img_gallery) {
9+
img2img_gallery = attachGalleryListeners("img2img")
10+
}
11+
if (!modal) {
12+
modal = gradioApp().getElementById('lightboxModal')
13+
modalObserver.observe(modal, { attributes : true, attributeFilter : ['style'] });
14+
}
15+
});
16+
17+
let modalObserver = new MutationObserver(function(mutations) {
18+
mutations.forEach(function(mutationRecord) {
19+
let selectedTab = gradioApp().querySelector('#tabs div button.bg-white')?.innerText
20+
if (mutationRecord.target.style.display === 'none' && selectedTab === 'txt2img' || selectedTab === 'img2img')
21+
gradioApp().getElementById(selectedTab+"_generation_info_button").click()
22+
});
23+
});
24+
25+
function attachGalleryListeners(tab_name) {
26+
gallery = gradioApp().querySelector('#'+tab_name+'_gallery')
27+
gallery?.addEventListener('click', () => gradioApp().getElementById(tab_name+"_generation_info_button").click());
28+
gallery?.addEventListener('keydown', (e) => {
29+
if (e.keyCode == 37 || e.keyCode == 39) // left or right arrow
30+
gradioApp().getElementById(tab_name+"_generation_info_button").click()
31+
});
32+
return gallery;
33+
}

launch.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,26 @@ def version_check(commit):
105105
print("version check failed", e)
106106

107107

108+
def run_extension_installer(extension_dir):
109+
path_installer = os.path.join(extension_dir, "install.py")
110+
if not os.path.isfile(path_installer):
111+
return
112+
113+
try:
114+
env = os.environ.copy()
115+
env['PYTHONPATH'] = os.path.abspath(".")
116+
117+
print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {extension_dir}", custom_env=env))
118+
except Exception as e:
119+
print(e, file=sys.stderr)
120+
121+
108122
def run_extensions_installers():
109123
if not os.path.isdir(dir_extensions):
110124
return
111125

112126
for dirname_extension in os.listdir(dir_extensions):
113-
path_installer = os.path.join(dir_extensions, dirname_extension, "install.py")
114-
if not os.path.isfile(path_installer):
115-
continue
116-
117-
try:
118-
env = os.environ.copy()
119-
env['PYTHONPATH'] = os.path.abspath(".")
120-
121-
print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}", custom_env=env))
122-
except Exception as e:
123-
print(e, file=sys.stderr)
127+
run_extension_installer(os.path.join(dir_extensions, dirname_extension))
124128

125129

126130
def prepare_enviroment():
@@ -135,9 +139,9 @@ def prepare_enviroment():
135139
xformers_windows_package = os.environ.get('XFORMERS_WINDOWS_PACKAGE', 'https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl')
136140

137141
stable_diffusion_repo = os.environ.get('STABLE_DIFFUSION_REPO', "https://github.com/CompVis/stable-diffusion.git")
138-
taming_transformers_repo = os.environ.get('TAMING_REANSFORMERS_REPO', "https://github.com/CompVis/taming-transformers.git")
142+
taming_transformers_repo = os.environ.get('TAMING_TRANSFORMERS_REPO', "https://github.com/CompVis/taming-transformers.git")
139143
k_diffusion_repo = os.environ.get('K_DIFFUSION_REPO', 'https://github.com/crowsonkb/k-diffusion.git')
140-
codeformer_repo = os.environ.get('CODEFORMET_REPO', 'https://github.com/sczhou/CodeFormer.git')
144+
codeformer_repo = os.environ.get('CODEFORMER_REPO', 'https://github.com/sczhou/CodeFormer.git')
141145
blip_repo = os.environ.get('BLIP_REPO', 'https://github.com/salesforce/BLIP.git')
142146

143147
stable_diffusion_commit_hash = os.environ.get('STABLE_DIFFUSION_COMMIT_HASH', "69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc")

localizations/ar_AR.json

Lines changed: 0 additions & 518 deletions
This file was deleted.

localizations/de_DE.json

Lines changed: 0 additions & 458 deletions
This file was deleted.

localizations/es_ES.json

Lines changed: 0 additions & 692 deletions
This file was deleted.

localizations/fr_FR.json

Lines changed: 0 additions & 415 deletions
This file was deleted.

localizations/it_IT.json

Lines changed: 0 additions & 1565 deletions
This file was deleted.

localizations/ja_JP.json

Lines changed: 0 additions & 482 deletions
This file was deleted.

localizations/ko_KR.json

Lines changed: 0 additions & 592 deletions
This file was deleted.

localizations/pt_BR.json

Lines changed: 0 additions & 485 deletions
This file was deleted.

0 commit comments

Comments
 (0)