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
94c01aa3
Commit
94c01aa3
authored
Oct 12, 2022
by
Greg Fuller
Committed by
AUTOMATIC1111
Oct 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw_xy_grid provides the option to also return lone images
parent
fde7fefa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
xy_grid.py
scripts/xy_grid.py
+12
-5
No files found.
scripts/xy_grid.py
View file @
94c01aa3
...
@@ -175,8 +175,9 @@ axis_options = [
...
@@ -175,8 +175,9 @@ axis_options = [
]
]
def
draw_xy_grid
(
p
,
xs
,
ys
,
x_labels
,
y_labels
,
cell
,
draw_legend
):
def
draw_xy_grid
(
p
,
xs
,
ys
,
x_labels
,
y_labels
,
cell
,
draw_legend
,
include_lone_images
):
res
=
[]
res
=
[]
successful_images
=
[]
ver_texts
=
[[
images
.
GridAnnotation
(
y
)]
for
y
in
y_labels
]
ver_texts
=
[[
images
.
GridAnnotation
(
y
)]
for
y
in
y_labels
]
hor_texts
=
[[
images
.
GridAnnotation
(
x
)]
for
x
in
x_labels
]
hor_texts
=
[[
images
.
GridAnnotation
(
x
)]
for
x
in
x_labels
]
...
@@ -194,7 +195,9 @@ def draw_xy_grid(p, xs, ys, x_labels, y_labels, cell, draw_legend):
...
@@ -194,7 +195,9 @@ def draw_xy_grid(p, xs, ys, x_labels, y_labels, cell, draw_legend):
first_processed
=
processed
first_processed
=
processed
try
:
try
:
res
.
append
(
processed
.
images
[
0
])
processed_image
=
processed
.
images
[
0
]
res
.
append
(
processed_image
)
successful_images
.
append
(
processed_image
)
except
:
except
:
res
.
append
(
Image
.
new
(
res
[
0
]
.
mode
,
res
[
0
]
.
size
))
res
.
append
(
Image
.
new
(
res
[
0
]
.
mode
,
res
[
0
]
.
size
))
...
@@ -203,6 +206,8 @@ def draw_xy_grid(p, xs, ys, x_labels, y_labels, cell, draw_legend):
...
@@ -203,6 +206,8 @@ def draw_xy_grid(p, xs, ys, x_labels, y_labels, cell, draw_legend):
grid
=
images
.
draw_grid_annotations
(
grid
,
res
[
0
]
.
width
,
res
[
0
]
.
height
,
hor_texts
,
ver_texts
)
grid
=
images
.
draw_grid_annotations
(
grid
,
res
[
0
]
.
width
,
res
[
0
]
.
height
,
hor_texts
,
ver_texts
)
first_processed
.
images
=
[
grid
]
first_processed
.
images
=
[
grid
]
if
include_lone_images
:
first_processed
.
images
+=
successful_images
return
first_processed
return
first_processed
...
@@ -229,11 +234,12 @@ class Script(scripts.Script):
...
@@ -229,11 +234,12 @@ class Script(scripts.Script):
y_values
=
gr
.
Textbox
(
label
=
"Y values"
,
visible
=
False
,
lines
=
1
)
y_values
=
gr
.
Textbox
(
label
=
"Y values"
,
visible
=
False
,
lines
=
1
)
draw_legend
=
gr
.
Checkbox
(
label
=
'Draw legend'
,
value
=
True
)
draw_legend
=
gr
.
Checkbox
(
label
=
'Draw legend'
,
value
=
True
)
include_lone_images
=
gr
.
Checkbox
(
label
=
'Include Separate Images'
,
value
=
True
)
no_fixed_seeds
=
gr
.
Checkbox
(
label
=
'Keep -1 for seeds'
,
value
=
False
)
no_fixed_seeds
=
gr
.
Checkbox
(
label
=
'Keep -1 for seeds'
,
value
=
False
)
return
[
x_type
,
x_values
,
y_type
,
y_values
,
draw_legend
,
no_fixed_seeds
]
return
[
x_type
,
x_values
,
y_type
,
y_values
,
draw_legend
,
include_lone_images
,
no_fixed_seeds
]
def
run
(
self
,
p
,
x_type
,
x_values
,
y_type
,
y_values
,
draw_legend
,
no_fixed_seeds
):
def
run
(
self
,
p
,
x_type
,
x_values
,
y_type
,
y_values
,
draw_legend
,
include_lone_images
,
no_fixed_seeds
):
if
not
no_fixed_seeds
:
if
not
no_fixed_seeds
:
modules
.
processing
.
fix_seed
(
p
)
modules
.
processing
.
fix_seed
(
p
)
...
@@ -344,7 +350,8 @@ class Script(scripts.Script):
...
@@ -344,7 +350,8 @@ class Script(scripts.Script):
x_labels
=
[
x_opt
.
format_value
(
p
,
x_opt
,
x
)
for
x
in
xs
],
x_labels
=
[
x_opt
.
format_value
(
p
,
x_opt
,
x
)
for
x
in
xs
],
y_labels
=
[
y_opt
.
format_value
(
p
,
y_opt
,
y
)
for
y
in
ys
],
y_labels
=
[
y_opt
.
format_value
(
p
,
y_opt
,
y
)
for
y
in
ys
],
cell
=
cell
,
cell
=
cell
,
draw_legend
=
draw_legend
draw_legend
=
draw_legend
,
include_lone_images
=
include_lone_images
)
)
if
opts
.
grid_save
:
if
opts
.
grid_save
:
...
...
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