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
4d634dc5
Commit
4d634dc5
authored
Jan 26, 2023
by
EllangoK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds components to infotext_fields
allows for loading script params
parent
e57b5f7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
scripts.py
modules/scripts.py
+14
-0
xyz_grid.py
scripts/xyz_grid.py
+10
-0
No files found.
modules/scripts.py
View file @
4d634dc5
...
...
@@ -330,6 +330,20 @@ class ScriptRunner:
outputs
=
[
script
.
group
for
script
in
self
.
selectable_scripts
]
)
self
.
script_load_ctr
=
0
def
onload_script_visibility
(
params
):
title
=
params
.
get
(
'Script'
,
None
)
if
title
:
title_index
=
self
.
titles
.
index
(
title
)
visibility
=
title_index
==
self
.
script_load_ctr
self
.
script_load_ctr
=
(
self
.
script_load_ctr
+
1
)
%
len
(
self
.
titles
)
return
gr
.
update
(
visible
=
visibility
)
else
:
return
gr
.
update
(
visible
=
False
)
self
.
infotext_fields
.
append
(
(
dropdown
,
lambda
x
:
gr
.
update
(
value
=
x
.
get
(
'Script'
,
'None'
)))
)
self
.
infotext_fields
.
extend
(
[(
script
.
group
,
onload_script_visibility
)
for
script
in
self
.
selectable_scripts
]
)
return
inputs
def
run
(
self
,
p
:
StableDiffusionProcessing
,
*
args
):
...
...
scripts/xyz_grid.py
View file @
4d634dc5
...
...
@@ -383,6 +383,15 @@ class Script(scripts.Script):
y_type
.
change
(
fn
=
select_axis
,
inputs
=
[
y_type
],
outputs
=
[
fill_y_button
])
z_type
.
change
(
fn
=
select_axis
,
inputs
=
[
z_type
],
outputs
=
[
fill_z_button
])
self
.
infotext_fields
=
(
(
x_type
,
"X Type"
),
(
x_values
,
"X Values"
),
(
y_type
,
"Y Type"
),
(
y_values
,
"Y Values"
),
(
z_type
,
"Z Type"
),
(
z_values
,
"Z Values"
),
)
return
[
x_type
,
x_values
,
y_type
,
y_values
,
z_type
,
z_values
,
draw_legend
,
include_lone_images
,
include_sub_grids
,
no_fixed_seeds
]
def
run
(
self
,
p
,
x_type
,
x_values
,
y_type
,
y_values
,
z_type
,
z_values
,
draw_legend
,
include_lone_images
,
include_sub_grids
,
no_fixed_seeds
):
...
...
@@ -541,6 +550,7 @@ class Script(scripts.Script):
if
grid_infotext
[
0
]
is
None
:
pc
.
extra_generation_params
=
copy
(
pc
.
extra_generation_params
)
pc
.
extra_generation_params
[
'Script'
]
=
self
.
title
()
if
x_opt
.
label
!=
'Nothing'
:
pc
.
extra_generation_params
[
"X Type"
]
=
x_opt
.
label
...
...
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