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
ee0505dd
Commit
ee0505dd
authored
Oct 21, 2022
by
papuSpartan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only delete prompt on back end and remove client-side deletion
parent
9ba372de
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
ui.js
javascript/ui.js
+0
-6
ui.py
modules/ui.py
+15
-14
No files found.
javascript/ui.js
View file @
ee0505dd
...
...
@@ -171,14 +171,8 @@ return [_, confirmed]
}
if
(
selected_tab_id
()
==
"tab_txt2img"
)
{
gradioApp
().
querySelector
(
"#txt2img_prompt > label > textarea"
).
value
=
""
;
gradioApp
().
querySelector
(
"#txt2img_neg_prompt > label > textarea"
).
value
=
""
;
update_token_counter
(
"img2img_token_button"
)
}
else
{
gradioApp
().
querySelector
(
"#img2img_prompt > label > textarea"
).
value
=
""
;
gradioApp
().
querySelector
(
"#img2img_neg_prompt > label > textarea"
).
value
=
""
;
update_token_counter
(
"txt2img_token_button"
)
}
...
...
modules/ui.py
View file @
ee0505dd
...
...
@@ -429,15 +429,21 @@ def create_seed_inputs():
return
seed
,
reuse_seed
,
subseed
,
reuse_subseed
,
subseed_strength
,
seed_resize_from_h
,
seed_resize_from_w
,
seed_checkbox
def
clear_prompt
(
prompt
):
print
(
f
"type: '{prompt}'"
)
print
(
prompt
)
def
connect_trash_prompt
(
_
,
confirmed
):
if
(
confirmed
):
# update_token_counter(prompt, steps)
return
""
return
[
""
,
confirmed
]
def
connect_trash_prompt
(
prompt
,
confirmed
):
if
(
confirmed
):
clear_prompt
(
prompt
)
def
trash_prompt_click
(
button
,
prompt
):
dummy_component
=
gradio
.
Label
(
visible
=
False
)
button
.
click
(
_js
=
"trash_prompt"
,
fn
=
connect_trash_prompt
,
inputs
=
[
prompt
,
dummy_component
],
outputs
=
[
prompt
,
dummy_component
],
)
def
connect_reuse_seed
(
seed
:
gr
.
Number
,
reuse_seed
:
gr
.
Button
,
generation_info
:
gr
.
Textbox
,
dummy_component
,
is_subseed
):
...
...
@@ -643,13 +649,7 @@ def create_ui(wrap_gradio_gpu_call):
txt_prompt_img
=
gr
.
File
(
label
=
""
,
elem_id
=
"txt2img_prompt_image"
,
file_count
=
"single"
,
type
=
"bytes"
,
visible
=
False
)
trash_prompt_button
.
click
(
# fn=lambda: print("Clearing prompt"),
_js
=
"trash_prompt"
,
fn
=
lambda
:
clear_prompt
(),
inputs
=
[
txt2img_prompt
,
dummy_component
],
outputs
=
[
txt2img_prompt
,
dummy_component
],
)
trash_prompt_click
(
trash_prompt_button
,
txt2img_prompt
)
with
gr
.
Row
(
elem_id
=
'txt2img_progress_row'
):
...
...
@@ -858,6 +858,7 @@ def create_ui(wrap_gradio_gpu_call):
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
)
trash_prompt_click
(
trash_prompt_button
,
img2img_prompt
)
with
gr
.
Row
(
elem_id
=
'img2img_progress_row'
):
img2img_prompt_img
=
gr
.
File
(
label
=
""
,
elem_id
=
"img2img_prompt_image"
,
file_count
=
"single"
,
type
=
"bytes"
,
visible
=
False
)
...
...
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