Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
9e40520f
Commit
9e40520f
authored
Oct 21, 2022
by
papuSpartan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor internal terminology to use 'clear' instead of 'trash' like #2728
parent
de70ddaf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
ui.js
javascript/ui.js
+1
-1
shared.py
modules/shared.py
+1
-1
ui.py
modules/ui.py
+11
-11
No files found.
javascript/ui.js
View file @
9e40520f
...
...
@@ -162,7 +162,7 @@ function selected_tab_id() {
}
function
trash
_prompt
(
_
,
confirmed
,
_steps
)
{
function
clear
_prompt
(
_
,
confirmed
,
_steps
)
{
if
(
confirm
(
"Delete prompt?"
))
{
confirmed
=
true
...
...
modules/shared.py
View file @
9e40520f
...
...
@@ -317,7 +317,7 @@ options_templates.update(options_section(('ui', "User interface"), {
"js_modal_lightbox"
:
OptionInfo
(
True
,
"Enable full page image viewer"
),
"js_modal_lightbox_initially_zoomed"
:
OptionInfo
(
True
,
"Show images zoomed in by default in full page image viewer"
),
"show_progress_in_title"
:
OptionInfo
(
True
,
"Show generation progress in window title."
),
"
trash_prompt_visible"
:
OptionInfo
(
True
,
"Show trash
prompt button"
),
"
clear_prompt_visible"
:
OptionInfo
(
True
,
"Show clear
prompt button"
),
'quicksettings'
:
OptionInfo
(
"sd_model_checkpoint"
,
"Quicksettings list"
),
'localization'
:
OptionInfo
(
"None"
,
"Localization (requires restart)"
,
gr
.
Dropdown
,
lambda
:
{
"choices"
:
[
"None"
]
+
list
(
localization
.
localizations
.
keys
())},
refresh
=
lambda
:
localization
.
list_localizations
(
cmd_opts
.
localizations_dir
)),
}))
...
...
modules/ui.py
View file @
9e40520f
...
...
@@ -88,7 +88,7 @@ folder_symbol = '\U0001f4c2' # 📂
refresh_symbol
=
'
\U0001f504
'
# 🔄
save_style_symbol
=
'
\U0001f4be
'
# 💾
apply_style_symbol
=
'
\U0001f4cb
'
# 📋
trash_prompt_symbol
=
'
\U0001F5D1
'
#
clear_prompt_symbol
=
'
\U0001F5D1
'
# 🗑️
def
plaintext_to_html
(
text
):
...
...
@@ -430,14 +430,14 @@ def create_seed_inputs():
def
c
onnect_trash
_prompt
(
_prompt
,
confirmed
,
_token_counter
):
def
c
lear
_prompt
(
_prompt
,
confirmed
,
_token_counter
):
if
(
confirmed
):
return
[
""
,
confirmed
,
update_token_counter
(
""
,
1
)]
def
trash_prompt_click
(
button
,
prompt
,
_dummy_confirmed
,
token_counter
):
def
connect_clear_prompt
(
button
,
prompt
,
_dummy_confirmed
,
token_counter
):
button
.
click
(
_js
=
"
trash
_prompt"
,
fn
=
c
onnect_trash
_prompt
,
_js
=
"
clear
_prompt"
,
fn
=
c
lear
_prompt
,
inputs
=
[
prompt
,
_dummy_confirmed
,
token_counter
],
outputs
=
[
prompt
,
_dummy_confirmed
,
token_counter
],
)
...
...
@@ -518,7 +518,7 @@ def create_toprow(is_img2img):
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"
)
trash_prompt
=
gr
.
Button
(
value
=
trash_prompt_symbol
,
elem_id
=
"trash_prompt"
,
visible
=
opts
.
trash
_prompt_visible
)
clear_prompt_button
=
gr
.
Button
(
value
=
clear_prompt_symbol
,
elem_id
=
"clear_prompt"
,
visible
=
opts
.
clear
_prompt_visible
)
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"
)
...
...
@@ -559,7 +559,7 @@ def create_toprow(is_img2img):
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
())))
prompt_style2
.
save_to_config
=
True
return
prompt
,
roll
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
,
trash_prompt
return
prompt
,
roll
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
,
clear_prompt_button
def
setup_progressbar
(
progressbar
,
preview
,
id_part
,
textinfo
=
None
):
...
...
@@ -640,7 +640,7 @@ def create_ui(wrap_gradio_gpu_call):
with
gr
.
Blocks
(
analytics_enabled
=
False
)
as
txt2img_interface
:
txt2img_prompt
,
roll
,
txt2img_prompt_style
,
txt2img_negative_prompt
,
txt2img_prompt_style2
,
submit
,
_
,
_
,
\
txt2img_prompt_style_apply
,
txt2img_save_style
,
txt2img_paste
,
token_counter
,
\
token_button
,
trash
_prompt_button
=
create_toprow
(
is_img2img
=
False
)
token_button
,
clear
_prompt_button
=
create_toprow
(
is_img2img
=
False
)
dummy_component
=
gr
.
Label
(
visible
=
False
)
txt_prompt_img
=
gr
.
File
(
label
=
""
,
elem_id
=
"txt2img_prompt_image"
,
file_count
=
"single"
,
type
=
"bytes"
,
visible
=
False
)
...
...
@@ -716,7 +716,7 @@ def create_ui(wrap_gradio_gpu_call):
connect_reuse_seed
(
seed
,
reuse_seed
,
generation_info
,
dummy_component
,
is_subseed
=
False
)
connect_reuse_seed
(
subseed
,
reuse_subseed
,
generation_info
,
dummy_component
,
is_subseed
=
True
)
trash_prompt_click
(
trash
_prompt_button
,
txt2img_prompt
,
dummy_component
,
token_counter
)
connect_clear_prompt
(
clear
_prompt_button
,
txt2img_prompt
,
dummy_component
,
token_counter
)
txt2img_args
=
dict
(
fn
=
wrap_gradio_gpu_call
(
modules
.
txt2img
.
txt2img
),
...
...
@@ -853,7 +853,7 @@ def create_ui(wrap_gradio_gpu_call):
with
gr
.
Blocks
(
analytics_enabled
=
False
)
as
img2img_interface
:
img2img_prompt
,
roll
,
img2img_prompt_style
,
img2img_negative_prompt
,
img2img_prompt_style2
,
submit
,
\
img2img_interrogate
,
img2img_deepbooru
,
img2img_prompt_style_apply
,
img2img_save_style
,
img2img_paste
,
\
token_counter
,
token_button
,
trash
_prompt_button
=
create_toprow
(
is_img2img
=
True
)
token_counter
,
token_button
,
clear
_prompt_button
=
create_toprow
(
is_img2img
=
True
)
with
gr
.
Row
(
elem_id
=
'img2img_progress_row'
):
...
...
@@ -954,7 +954,7 @@ def create_ui(wrap_gradio_gpu_call):
connect_reuse_seed
(
seed
,
reuse_seed
,
generation_info
,
dummy_component
,
is_subseed
=
False
)
connect_reuse_seed
(
subseed
,
reuse_subseed
,
generation_info
,
dummy_component
,
is_subseed
=
True
)
trash_prompt_click
(
trash
_prompt_button
,
img2img_prompt
,
dummy_component
,
token_counter
)
connect_clear_prompt
(
clear
_prompt_button
,
img2img_prompt
,
dummy_component
,
token_counter
)
img2img_prompt_img
.
change
(
fn
=
modules
.
images
.
image_data
,
...
...
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