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
2922d814
Commit
2922d814
authored
Oct 29, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make existing image browser extension not break
parent
af547f63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
modules/generation_parameters_copypaste.py
modules/generation_parameters_copypaste.py
+14
-5
No files found.
modules/generation_parameters_copypaste.py
View file @
2922d814
...
...
@@ -51,7 +51,14 @@ def image_from_url_text(filedata):
def
add_paste_fields
(
tabname
,
init_img
,
fields
):
paste_fields
[
tabname
]
=
{
"init_img"
:
init_img
,
"fields"
:
fields
}
paste_fields
[
tabname
]
=
{
"init_img"
:
init_img
,
"fields"
:
fields
}
# backwards compatibility for existing extensions
import
modules.ui
if
tabname
==
'txt2img'
:
modules
.
ui
.
txt2img_paste_fields
=
fields
elif
tabname
==
'img2img'
:
modules
.
ui
.
img2img_paste_fields
=
fields
def
create_buttons
(
tabs_list
):
...
...
@@ -61,7 +68,7 @@ def create_buttons(tabs_list):
return
buttons
#if send_generate_info is a tab name, mean generate_info comes from the params fields of the tab
#if send_generate_info is a tab name, mean generate_info comes from the params fields of the tab
def
bind_buttons
(
buttons
,
send_image
,
send_generate_info
):
bind_list
.
append
([
buttons
,
send_image
,
send_generate_info
])
...
...
@@ -84,12 +91,12 @@ def run_bind():
inputs
=
[
send_image
],
outputs
=
[
paste_fields
[
tab
][
"init_img"
]],
)
if
send_generate_info
and
paste_fields
[
tab
][
"fields"
]
is
not
None
:
paste_field_names
=
[
'Prompt'
,
'Negative prompt'
,
'Steps'
,
'Face restoration'
,
'Size-1'
,
'Size-2'
]
if
shared
.
opts
.
send_seed
:
paste_field_names
+=
[
"Seed"
]
if
send_generate_info
in
paste_fields
:
if
send_generate_info
in
paste_fields
:
button
.
click
(
fn
=
lambda
*
x
:
x
,
inputs
=
[
field
for
field
,
name
in
paste_fields
[
send_generate_info
][
"fields"
]
if
name
in
paste_field_names
],
...
...
@@ -154,7 +161,8 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
return
res
def
connect_paste
(
button
,
paste_fields
,
input_comp
):
def
connect_paste
(
button
,
paste_fields
,
input_comp
,
jsfunc
=
None
):
def
paste_func
(
prompt
):
if
not
prompt
and
not
shared
.
cmd_opts
.
hide_ui_dir_config
:
filename
=
os
.
path
.
join
(
script_path
,
"params.txt"
)
...
...
@@ -192,6 +200,7 @@ def connect_paste(button, paste_fields, input_comp):
button
.
click
(
fn
=
paste_func
,
_js
=
jsfunc
,
inputs
=
[
input_comp
],
outputs
=
[
x
[
0
]
for
x
in
paste_fields
],
)
...
...
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