Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
d3463bc5
Commit
d3463bc5
authored
Oct 15, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change styling for top right corner UI
made save style button not die when you cancel
parent
f7ca6393
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
38 deletions
+39
-38
javascript/hints.js
javascript/hints.js
+2
-0
javascript/ui.js
javascript/ui.js
+1
-1
modules/ui.py
modules/ui.py
+28
-29
style.css
style.css
+8
-8
No files found.
javascript/hints.js
View file @
d3463bc5
...
...
@@ -16,6 +16,8 @@ titles = {
"
\
u{1f3a8}
"
:
"
Add a random artist to the prompt.
"
,
"
\
u2199
\
ufe0f
"
:
"
Read generation parameters from prompt or last generation if prompt is empty into user interface.
"
,
"
\
u{1f4c2}
"
:
"
Open images output directory
"
,
"
\
u{1f4be}
"
:
"
Save style
"
,
"
\
u{1f4cb}
"
:
"
Apply selected styles to current prompt
"
,
"
Inpaint a part of image
"
:
"
Draw a mask over an image, and the script will regenerate the masked area with content according to prompt
"
,
"
SD upscale
"
:
"
Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back
"
,
...
...
javascript/ui.js
View file @
d3463bc5
...
...
@@ -141,7 +141,7 @@ function submit_img2img(){
function
ask_for_style_name
(
_
,
prompt_text
,
negative_prompt_text
)
{
name_
=
prompt
(
'
Style name:
'
)
return
name_
===
null
?
[
null
,
null
,
null
]:
[
name_
,
prompt_text
,
negative_prompt_text
]
return
[
name_
,
prompt_text
,
negative_prompt_text
]
}
...
...
modules/ui.py
View file @
d3463bc5
...
...
@@ -81,6 +81,8 @@ art_symbol = '\U0001f3a8' # 🎨
paste_symbol
=
'
\u2199\ufe0f
'
# ↙
folder_symbol
=
'
\U0001f4c2
'
# 📂
refresh_symbol
=
'
\U0001f504
'
# 🔄
save_style_symbol
=
'
\U0001f4be
'
# 💾
apply_style_symbol
=
'
\U0001f4cb
'
# 📋
def
plaintext_to_html
(
text
):
...
...
@@ -322,7 +324,7 @@ def visit(x, func, path=""):
def
add_style
(
name
:
str
,
prompt
:
str
,
negative_prompt
:
str
):
if
name
is
None
:
return
[
gr_show
()
,
gr_show
(
)]
return
[
gr_show
()
for
x
in
range
(
4
)]
style
=
modules
.
styles
.
PromptStyle
(
name
,
prompt
,
negative_prompt
)
shared
.
prompt_styles
.
styles
[
style
.
name
]
=
style
...
...
@@ -447,7 +449,7 @@ def create_toprow(is_img2img):
id_part
=
"img2img"
if
is_img2img
else
"txt2img"
with
gr
.
Row
(
elem_id
=
"toprow"
):
with
gr
.
Column
(
scale
=
4
):
with
gr
.
Column
(
scale
=
6
):
with
gr
.
Row
():
with
gr
.
Column
(
scale
=
80
):
with
gr
.
Row
():
...
...
@@ -455,27 +457,30 @@ def create_toprow(is_img2img):
placeholder
=
"Prompt (press Ctrl+Enter or Alt+Enter to generate)"
)
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"roll_col"
):
roll
=
gr
.
Button
(
value
=
art_symbol
,
elem_id
=
"roll"
,
visible
=
len
(
shared
.
artist_db
.
artists
)
>
0
)
paste
=
gr
.
Button
(
value
=
paste_symbol
,
elem_id
=
"paste"
)
token_counter
=
gr
.
HTML
(
value
=
"<span></span>"
,
elem_id
=
f
"{id_part}_token_counter"
)
token_button
=
gr
.
Button
(
visible
=
False
,
elem_id
=
f
"{id_part}_token_button"
)
with
gr
.
Column
(
scale
=
10
,
elem_id
=
"style_pos_col"
):
prompt_style
=
gr
.
Dropdown
(
label
=
"Style 1"
,
elem_id
=
f
"{id_part}_style_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())),
visible
=
len
(
shared
.
prompt_styles
.
styles
)
>
1
)
with
gr
.
Row
():
with
gr
.
Column
(
scale
=
8
):
with
gr
.
Column
(
scale
=
8
0
):
with
gr
.
Row
():
negative_prompt
=
gr
.
Textbox
(
label
=
"Negative prompt"
,
elem_id
=
f
"{id_part}_neg_prompt"
,
show_label
=
False
,
lines
=
2
,
placeholder
=
"Negative prompt (press Ctrl+Enter or Alt+Enter to generate)"
)
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"roll_col"
):
sh
=
gr
.
Button
(
elem_id
=
"sh"
,
visible
=
True
)
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"roll_col"
):
roll
=
gr
.
Button
(
value
=
art_symbol
,
elem_id
=
"roll"
,
visible
=
len
(
shared
.
artist_db
.
artists
)
>
0
)
paste
=
gr
.
Button
(
value
=
paste_symbol
,
elem_id
=
"paste"
)
save_style
=
gr
.
Button
(
value
=
save_style_symbol
,
elem_id
=
"style_create"
)
prompt_style_apply
=
gr
.
Button
(
value
=
apply_style_symbol
,
elem_id
=
"style_apply"
)
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_neg_col"
):
prompt_style2
=
gr
.
Dropdown
(
label
=
"Style 2"
,
elem_id
=
f
"{id_part}_style2_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())),
visible
=
len
(
shared
.
prompt_styles
.
styles
)
>
1
)
token_counter
=
gr
.
HTML
(
value
=
"<span></span>"
,
elem_id
=
f
"{id_part}_token_counter"
)
token_button
=
gr
.
Button
(
visible
=
False
,
elem_id
=
f
"{id_part}_token_button"
)
button_interrogate
=
None
button_deepbooru
=
None
if
is_img2img
:
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"interrogate_col"
):
button_interrogate
=
gr
.
Button
(
'Interrogate
\n
CLIP'
,
elem_id
=
"interrogate"
)
if
cmd_opts
.
deepdanbooru
:
button_deepbooru
=
gr
.
Button
(
'Interrogate
\n
DeepBooru'
,
elem_id
=
"deepbooru"
)
with
gr
.
Column
(
scale
=
1
):
with
gr
.
Row
():
...
...
@@ -495,20 +500,14 @@ def create_toprow(is_img2img):
outputs
=
[],
)
with
gr
.
Row
(
scale
=
1
):
if
is_img2img
:
interrogate
=
gr
.
Button
(
'Interrogate
\n
CLIP'
,
elem_id
=
"interrogate"
)
if
cmd_opts
.
deepdanbooru
:
deepbooru
=
gr
.
Button
(
'Interrogate
\n
DeepBooru'
,
elem_id
=
"deepbooru"
)
else
:
deepbooru
=
None
else
:
interrogate
=
None
deepbooru
=
None
prompt_style_apply
=
gr
.
Button
(
'Apply style'
,
elem_id
=
"style_apply"
)
save_style
=
gr
.
Button
(
'Create style'
,
elem_id
=
"style_create"
)
with
gr
.
Row
():
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_pos_col"
):
prompt_style
=
gr
.
Dropdown
(
label
=
"Style 1"
,
elem_id
=
f
"{id_part}_style_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())))
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_neg_col"
):
prompt_style2
=
gr
.
Dropdown
(
label
=
"Style 2"
,
elem_id
=
f
"{id_part}_style2_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())))
return
prompt
,
roll
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
interrogate
,
deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
return
prompt
,
roll
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_
deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
def
setup_progressbar
(
progressbar
,
preview
,
id_part
,
textinfo
=
None
):
...
...
style.css
View file @
d3463bc5
...
...
@@ -115,7 +115,7 @@
padding
:
0.4em
0
;
}
#roll
,
#paste
{
#roll
,
#paste
,
#style_create
,
#style_apply
{
min-width
:
2em
;
min-height
:
2em
;
max-width
:
2em
;
...
...
@@ -126,14 +126,14 @@
margin
:
0.1em
0
;
}
#
style_apply
,
#style_create
,
#interrogate
{
m
argin
:
0.75em
0.25em
0.25em
0.25em
;
m
in-width
:
5em
;
#
interrogate_col
{
m
in-width
:
0
!important
;
m
ax-width
:
8em
!important
;
}
#style_apply
,
#style_create
,
#deepbooru
{
m
argin
:
0.75em
0.25em
0.25em
0.25
em
;
m
in-width
:
5
em
;
#interrogate
,
#deepbooru
{
margin
:
0em
0.25em
0.9em
0.25em
;
m
in-width
:
8
em
;
m
ax-width
:
8
em
;
}
#style_pos_col
,
#style_neg_col
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment