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
f093c9d3
Commit
f093c9d3
authored
Aug 13, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix broken XYZ plot seeds
add new callback for scripts to be used before processing
parent
3163d126
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
4 deletions
+47
-4
modules/processing.py
modules/processing.py
+30
-2
modules/processing_scripts/seed.py
modules/processing_scripts/seed.py
+1
-1
modules/scripts.py
modules/scripts.py
+16
-1
No files found.
modules/processing.py
View file @
f093c9d3
...
...
@@ -152,7 +152,9 @@ class StableDiffusionProcessing:
token_merging_ratio_hr
=
0
disable_extra_networks
:
bool
=
False
script_args
:
list
=
None
scripts_value
:
scripts
.
ScriptRunner
=
field
(
default
=
None
,
init
=
False
)
script_args_value
:
list
=
field
(
default
=
None
,
init
=
False
)
scripts_setup_complete
:
bool
=
field
(
default
=
False
,
init
=
False
)
cached_uc
=
[
None
,
None
]
cached_c
=
[
None
,
None
]
...
...
@@ -171,7 +173,6 @@ class StableDiffusionProcessing:
step_multiplier
:
int
=
field
(
default
=
1
,
init
=
False
)
color_corrections
:
list
=
field
(
default
=
None
,
init
=
False
)
scripts
:
list
=
field
(
default
=
None
,
init
=
False
)
all_prompts
:
list
=
field
(
default
=
None
,
init
=
False
)
all_negative_prompts
:
list
=
field
(
default
=
None
,
init
=
False
)
all_seeds
:
list
=
field
(
default
=
None
,
init
=
False
)
...
...
@@ -229,6 +230,33 @@ class StableDiffusionProcessing:
def
sd_model
(
self
,
value
):
pass
@
property
def
scripts
(
self
):
return
self
.
scripts_value
@
scripts
.
setter
def
scripts
(
self
,
value
):
self
.
scripts_value
=
value
if
self
.
scripts_value
and
self
.
script_args_value
and
not
self
.
scripts_setup_complete
:
self
.
setup_scripts
()
@
property
def
script_args
(
self
):
return
self
.
script_args_value
@
script_args
.
setter
def
script_args
(
self
,
value
):
self
.
script_args_value
=
value
if
self
.
scripts_value
and
self
.
script_args_value
and
not
self
.
scripts_setup_complete
:
self
.
setup_scripts
()
def
setup_scripts
(
self
):
self
.
scripts_setup_complete
=
True
self
.
scripts
.
setup_scrips
(
self
)
def
comment
(
self
,
text
):
self
.
comments
[
text
]
=
1
...
...
modules/processing_scripts/seed.py
View file @
f093c9d3
...
...
@@ -58,7 +58,7 @@ class ScriptSeed(scripts.ScriptBuiltin):
return
self
.
seed
,
subseed
,
subseed_strength
def
before_process
(
self
,
p
,
seed
,
subseed
,
subseed_strength
):
def
setup
(
self
,
p
,
seed
,
subseed
,
subseed_strength
):
p
.
seed
=
seed
if
subseed_strength
>
0
:
...
...
modules/scripts.py
View file @
f093c9d3
...
...
@@ -106,9 +106,16 @@ class Script:
pass
def
setup
(
self
,
p
,
*
args
):
"""For AlwaysVisible scripts, this function is called when the processing object is set up, before any processing starts.
args contains all values returned by components from ui().
"""
pass
def
before_process
(
self
,
p
,
*
args
):
"""
This function is called very early
before
processing begins for AlwaysVisible scripts.
This function is called very early
during
processing begins for AlwaysVisible scripts.
You can modify the processing object (p) here, inject hooks, etc.
args contains all values returned by components from ui()
"""
...
...
@@ -706,6 +713,14 @@ class ScriptRunner:
except
Exception
:
errors
.
report
(
f
"Error running before_hr: {script.filename}"
,
exc_info
=
True
)
def
setup_scrips
(
self
,
p
):
for
script
in
self
.
alwayson_scripts
:
try
:
script_args
=
p
.
script_args
[
script
.
args_from
:
script
.
args_to
]
script
.
setup
(
p
,
*
script_args
)
except
Exception
:
errors
.
report
(
f
"Error running setup: {script.filename}"
,
exc_info
=
True
)
scripts_txt2img
:
ScriptRunner
=
None
scripts_img2img
:
ScriptRunner
=
None
...
...
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