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
f44feb6a
Commit
f44feb6a
authored
Jun 30, 2023
by
Aarni Koskela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add job argument to State.begin()
parent
b70001e6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
16 deletions
+13
-16
modules/api/api.py
modules/api/api.py
+7
-7
modules/call_queue.py
modules/call_queue.py
+1
-1
modules/extras.py
modules/extras.py
+1
-2
modules/interrogate.py
modules/interrogate.py
+1
-2
modules/postprocessing.py
modules/postprocessing.py
+1
-2
modules/shared.py
modules/shared.py
+2
-2
No files found.
modules/api/api.py
View file @
f44feb6a
...
...
@@ -327,7 +327,7 @@ class Api:
p
.
outpath_grids
=
opts
.
outdir_txt2img_grids
p
.
outpath_samples
=
opts
.
outdir_txt2img_samples
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"scripts_txt2img"
)
if
selectable_scripts
is
not
None
:
p
.
script_args
=
script_args
processed
=
scripts
.
scripts_txt2img
.
run
(
p
,
*
p
.
script_args
)
# Need to pass args as list here
...
...
@@ -384,7 +384,7 @@ class Api:
p
.
outpath_grids
=
opts
.
outdir_img2img_grids
p
.
outpath_samples
=
opts
.
outdir_img2img_samples
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"scripts_img2img"
)
if
selectable_scripts
is
not
None
:
p
.
script_args
=
script_args
processed
=
scripts
.
scripts_img2img
.
run
(
p
,
*
p
.
script_args
)
# Need to pass args as list here
...
...
@@ -599,7 +599,7 @@ class Api:
def
create_embedding
(
self
,
args
:
dict
):
try
:
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"create_embedding"
)
filename
=
create_embedding
(
**
args
)
# create empty embedding
sd_hijack
.
model_hijack
.
embedding_db
.
load_textual_inversion_embeddings
()
# reload embeddings so new one can be immediately used
shared
.
state
.
end
()
...
...
@@ -610,7 +610,7 @@ class Api:
def
create_hypernetwork
(
self
,
args
:
dict
):
try
:
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"create_hypernetwork"
)
filename
=
create_hypernetwork
(
**
args
)
# create empty embedding
shared
.
state
.
end
()
return
models
.
CreateResponse
(
info
=
f
"create hypernetwork filename: {filename}"
)
...
...
@@ -620,7 +620,7 @@ class Api:
def
preprocess
(
self
,
args
:
dict
):
try
:
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"preprocess"
)
preprocess
(
**
args
)
# quick operation unless blip/booru interrogation is enabled
shared
.
state
.
end
()
return
models
.
PreprocessResponse
(
info
=
'preprocess complete'
)
...
...
@@ -636,7 +636,7 @@ class Api:
def
train_embedding
(
self
,
args
:
dict
):
try
:
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"train_embedding"
)
apply_optimizations
=
shared
.
opts
.
training_xattention_optimizations
error
=
None
filename
=
''
...
...
@@ -657,7 +657,7 @@ class Api:
def
train_hypernetwork
(
self
,
args
:
dict
):
try
:
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
"train_hypernetwork"
)
shared
.
loaded_hypernetworks
=
[]
apply_optimizations
=
shared
.
opts
.
training_xattention_optimizations
error
=
None
...
...
modules/call_queue.py
View file @
f44feb6a
...
...
@@ -30,7 +30,7 @@ def wrap_gradio_gpu_call(func, extra_outputs=None):
id_task
=
None
with
queue_lock
:
shared
.
state
.
begin
()
shared
.
state
.
begin
(
job
=
id_task
)
progress
.
start_task
(
id_task
)
try
:
...
...
modules/extras.py
View file @
f44feb6a
...
...
@@ -73,8 +73,7 @@ def to_half(tensor, enable):
def
run_modelmerger
(
id_task
,
primary_model_name
,
secondary_model_name
,
tertiary_model_name
,
interp_method
,
multiplier
,
save_as_half
,
custom_name
,
checkpoint_format
,
config_source
,
bake_in_vae
,
discard_weights
,
save_metadata
):
shared
.
state
.
begin
()
shared
.
state
.
job
=
'model-merge'
shared
.
state
.
begin
(
job
=
"model-merge"
)
def
fail
(
message
):
shared
.
state
.
textinfo
=
message
...
...
modules/interrogate.py
View file @
f44feb6a
...
...
@@ -184,8 +184,7 @@ class InterrogateModels:
def
interrogate
(
self
,
pil_image
):
res
=
""
shared
.
state
.
begin
()
shared
.
state
.
job
=
'interrogate'
shared
.
state
.
begin
(
job
=
"interrogate"
)
try
:
if
shared
.
cmd_opts
.
lowvram
or
shared
.
cmd_opts
.
medvram
:
lowvram
.
send_everything_to_cpu
()
...
...
modules/postprocessing.py
View file @
f44feb6a
...
...
@@ -9,8 +9,7 @@ from modules.shared import opts
def
run_postprocessing
(
extras_mode
,
image
,
image_folder
,
input_dir
,
output_dir
,
show_extras_results
,
*
args
,
save_output
:
bool
=
True
):
devices
.
torch_gc
()
shared
.
state
.
begin
()
shared
.
state
.
job
=
'extras'
shared
.
state
.
begin
(
job
=
"extras"
)
image_data
=
[]
image_names
=
[]
...
...
modules/shared.py
View file @
f44feb6a
...
...
@@ -173,7 +173,7 @@ class State:
return
obj
def
begin
(
self
):
def
begin
(
self
,
job
:
str
=
"(unknown)"
):
self
.
sampling_step
=
0
self
.
job_count
=
-
1
self
.
processing_has_refined_job_count
=
False
...
...
@@ -187,7 +187,7 @@ class State:
self
.
interrupted
=
False
self
.
textinfo
=
None
self
.
time_start
=
time
.
time
()
self
.
job
=
job
devices
.
torch_gc
()
def
end
(
self
):
...
...
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