Skip to content

Commit 5a8a3ef

Browse files
committed
UX/UI design improvements
1 parent 226d840 commit 5a8a3ef

File tree

9 files changed

+1717
-673
lines changed

9 files changed

+1717
-673
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,14 @@ notification.mp3
3333
/test/stdout.txt
3434
/test/stderr.txt
3535
/cache.json
36+
scripts/prompt_blending.py
37+
scripts/advanced_seed_blending.py
38+
scripts/CFG Auto.py
39+
scripts/CFG Schedule.py
40+
scripts/img2tiles.py
41+
scripts/interpolate.py
42+
scripts/loopback_superimpose.py
43+
models/VAE/Put VAE here.txt
44+
models/VAE-approx/model.pt
45+
models/Stable-diffusion/Put Stable Diffusion checkpoints here.txt
46+
models/deepbooru/Put your deepbooru release project folder here.txt

html/footer.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
22
<a href="/docs">API</a>
33
 • 
4-
<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">Github</a>
4+
<a href="https://github.com/anapnoe/stable-diffusion-webui">Github</a>
55
 • 
66
<a href="https://gradio.app">Gradio</a>
77
 • 
@@ -11,3 +11,5 @@
1111
<div class="versions">
1212
{versions}
1313
</div>
14+
15+

javascript/ui.js

+21
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,26 @@ onUiUpdate(function(){
277277
})
278278
}
279279
}
280+
281+
/*
282+
hack until gradio allows to add custom classes to components
283+
add elem_id= your_elem_id + "sub-group"
284+
285+
^ matches the start
286+
* matches any position
287+
$ matches the end
288+
289+
*/
290+
291+
gradioApp().querySelectorAll('[id *= "sub-group"]').forEach(function(elem){
292+
elem.classList.add("sub-group");
293+
console.log(elem.id);
294+
})
295+
296+
297+
298+
299+
280300
})
281301

282302
onOptionsChanged(function(){
@@ -317,6 +337,7 @@ function update_token_counter(button_id) {
317337

318338
function restart_reload(){
319339
document.body.innerHTML='<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>';
340+
document.body.style.backgroundColor = "#1a1a1a";
320341
setTimeout(function(){location.reload()},2000)
321342

322343
return []

modules/img2img.py

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args):
4545

4646
if state.interrupted:
4747
break
48+
49+
p.filename = os.path.basename(image)
4850

4951
img = Image.open(image)
5052
# Use the EXIF orientation of photos taken by smartphones.

modules/ui.py

+321-250
Large diffs are not rendered by default.

modules/ui_common.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def open_folder(f):
124124
sp.Popen(["xdg-open", path])
125125

126126
with gr.Column(variant='panel', elem_id=f"{tabname}_results"):
127+
127128
with gr.Group(elem_id=f"{tabname}_gallery_container"):
128129
result_gallery = gr.Gallery(label='Output', show_label=False, elem_id=f"{tabname}_gallery").style(grid=4)
129130

@@ -148,7 +149,8 @@ def open_folder(f):
148149
with gr.Row():
149150
download_files = gr.File(None, file_count="multiple", interactive=False, show_label=False, visible=False, elem_id=f'download_files_{tabname}')
150151

151-
with gr.Group():
152+
#with gr.Group():
153+
with gr.Accordion("Generation Info", open=False):
152154
html_info = gr.HTML(elem_id=f'html_info_{tabname}')
153155
html_log = gr.HTML(elem_id=f'html_log_{tabname}')
154156

modules/ui_components.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_block_name(self):
3030

3131
class FormGroup(gr.Group, gr.components.FormComponent):
3232
"""Same as gr.Row but fits inside gradio forms"""
33-
33+
3434
def get_block_name(self):
3535
return "group"
3636

@@ -56,3 +56,14 @@ def __init__(self, **kwargs):
5656

5757
def get_block_name(self):
5858
return "dropdown"
59+
60+
class FormSubGroup(gr.Group, gr.components.FormComponent):
61+
"""Same as gr.Row but fits inside gradio forms"""
62+
def __init__(self, **kwargs):
63+
self.variant = "sub-group"
64+
super().__init__(variant="sub-group", **kwargs)
65+
66+
def get_block_name(self):
67+
return "group"
68+
69+

screenshot.png

354 KB
Loading

0 commit comments

Comments
 (0)