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
91c8d0dc
Commit
91c8d0dc
authored
Jan 28, 2023
by
AUTOMATIC1111
Committed by
GitHub
Jan 28, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7231 from EllangoK/master
Fixes X/Y/Z Plot parameters not being restored from images
parents
fecb990d
591b68e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
modules/generation_parameters_copypaste.py
modules/generation_parameters_copypaste.py
+2
-2
modules/scripts.py
modules/scripts.py
+14
-0
scripts/xyz_grid.py
scripts/xyz_grid.py
+10
-0
No files found.
modules/generation_parameters_copypaste.py
View file @
91c8d0dc
...
@@ -13,7 +13,6 @@ from PIL import Image
...
@@ -13,7 +13,6 @@ from PIL import Image
re_param_code
=
r'\s*([\w ]+):\s*("(?:\\"[^,]|\\"|\\|[^\"])+"|[^,]*)(?:,|$)'
re_param_code
=
r'\s*([\w ]+):\s*("(?:\\"[^,]|\\"|\\|[^\"])+"|[^,]*)(?:,|$)'
re_param
=
re
.
compile
(
re_param_code
)
re_param
=
re
.
compile
(
re_param_code
)
re_params
=
re
.
compile
(
r"^(?:"
+
re_param_code
+
"){3,}$"
)
re_imagesize
=
re
.
compile
(
r"^(\d+)x(\d+)$"
)
re_imagesize
=
re
.
compile
(
r"^(\d+)x(\d+)$"
)
re_hypernet_hash
=
re
.
compile
(
"
\
(([0-9a-f]+)
\
)$"
)
re_hypernet_hash
=
re
.
compile
(
"
\
(([0-9a-f]+)
\
)$"
)
type_of_gr_update
=
type
(
gr
.
update
())
type_of_gr_update
=
type
(
gr
.
update
())
...
@@ -243,7 +242,7 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
...
@@ -243,7 +242,7 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
done_with_prompt
=
False
done_with_prompt
=
False
*
lines
,
lastline
=
x
.
strip
()
.
split
(
"
\n
"
)
*
lines
,
lastline
=
x
.
strip
()
.
split
(
"
\n
"
)
if
not
re_params
.
match
(
lastline
)
:
if
len
(
re_param
.
findall
(
lastline
))
<
3
:
lines
.
append
(
lastline
)
lines
.
append
(
lastline
)
lastline
=
''
lastline
=
''
...
@@ -262,6 +261,7 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
...
@@ -262,6 +261,7 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
res
[
"Negative prompt"
]
=
negative_prompt
res
[
"Negative prompt"
]
=
negative_prompt
for
k
,
v
in
re_param
.
findall
(
lastline
):
for
k
,
v
in
re_param
.
findall
(
lastline
):
v
=
v
[
1
:
-
1
]
if
v
[
0
]
==
'"'
and
v
[
-
1
]
==
'"'
else
v
m
=
re_imagesize
.
match
(
v
)
m
=
re_imagesize
.
match
(
v
)
if
m
is
not
None
:
if
m
is
not
None
:
res
[
k
+
"-1"
]
=
m
.
group
(
1
)
res
[
k
+
"-1"
]
=
m
.
group
(
1
)
...
...
modules/scripts.py
View file @
91c8d0dc
...
@@ -345,6 +345,20 @@ class ScriptRunner:
...
@@ -345,6 +345,20 @@ class ScriptRunner:
outputs
=
[
script
.
group
for
script
in
self
.
selectable_scripts
]
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
return
inputs
def
run
(
self
,
p
,
*
args
):
def
run
(
self
,
p
,
*
args
):
...
...
scripts/xyz_grid.py
View file @
91c8d0dc
...
@@ -383,6 +383,15 @@ class Script(scripts.Script):
...
@@ -383,6 +383,15 @@ class Script(scripts.Script):
y_type
.
change
(
fn
=
select_axis
,
inputs
=
[
y_type
],
outputs
=
[
fill_y_button
])
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
])
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
]
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
):
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
):
...
@@ -542,6 +551,7 @@ class Script(scripts.Script):
...
@@ -542,6 +551,7 @@ class Script(scripts.Script):
if
grid_infotext
[
0
]
is
None
:
if
grid_infotext
[
0
]
is
None
:
pc
.
extra_generation_params
=
copy
(
pc
.
extra_generation_params
)
pc
.
extra_generation_params
=
copy
(
pc
.
extra_generation_params
)
pc
.
extra_generation_params
[
'Script'
]
=
self
.
title
()
if
x_opt
.
label
!=
'Nothing'
:
if
x_opt
.
label
!=
'Nothing'
:
pc
.
extra_generation_params
[
"X Type"
]
=
x_opt
.
label
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