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
e1b128d8
Commit
e1b128d8
authored
Oct 04, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not touch p.seed/p.subseed during processing #1181
parent
957e29a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
modules/processing.py
modules/processing.py
+17
-9
No files found.
modules/processing.py
View file @
e1b128d8
...
...
@@ -248,9 +248,16 @@ def create_random_tensors(shape, seeds, subseeds=None, subseed_strength=0.0, see
return
x
def
get_fixed_seed
(
seed
):
if
seed
is
None
or
seed
==
''
or
seed
==
-
1
:
return
int
(
random
.
randrange
(
4294967294
))
return
seed
def
fix_seed
(
p
):
p
.
seed
=
int
(
random
.
randrange
(
4294967294
))
if
p
.
seed
is
None
or
p
.
seed
==
''
or
p
.
seed
==
-
1
else
p
.
seed
p
.
subseed
=
int
(
random
.
randrange
(
4294967294
))
if
p
.
subseed
is
None
or
p
.
subseed
==
''
or
p
.
subseed
==
-
1
else
p
.
subseed
p
.
seed
=
get_fixed_seed
(
p
.
seed
)
p
.
subseed
=
get_fixed_seed
(
p
.
subseed
)
def
create_infotext
(
p
,
all_prompts
,
all_seeds
,
all_subseeds
,
comments
,
iteration
=
0
,
position_in_batch
=
0
):
...
...
@@ -292,7 +299,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
devices
.
torch_gc
()
fix_seed
(
p
)
seed
=
get_fixed_seed
(
p
.
seed
)
subseed
=
get_fixed_seed
(
p
.
subseed
)
if
p
.
outpath_samples
is
not
None
:
os
.
makedirs
(
p
.
outpath_samples
,
exist_ok
=
True
)
...
...
@@ -311,15 +319,15 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
else
:
all_prompts
=
p
.
batch_size
*
p
.
n_iter
*
[
p
.
prompt
]
if
type
(
p
.
seed
)
==
list
:
all_seeds
=
p
.
seed
if
type
(
seed
)
==
list
:
all_seeds
=
seed
else
:
all_seeds
=
[
int
(
p
.
seed
)
+
(
x
if
p
.
subseed_strength
==
0
else
0
)
for
x
in
range
(
len
(
all_prompts
))]
all_seeds
=
[
int
(
seed
)
+
(
x
if
p
.
subseed_strength
==
0
else
0
)
for
x
in
range
(
len
(
all_prompts
))]
if
type
(
p
.
subseed
)
==
list
:
all_subseeds
=
p
.
subseed
if
type
(
subseed
)
==
list
:
all_subseeds
=
subseed
else
:
all_subseeds
=
[
int
(
p
.
subseed
)
+
x
for
x
in
range
(
len
(
all_prompts
))]
all_subseeds
=
[
int
(
subseed
)
+
x
for
x
in
range
(
len
(
all_prompts
))]
def
infotext
(
iteration
=
0
,
position_in_batch
=
0
):
return
create_infotext
(
p
,
all_prompts
,
all_seeds
,
all_subseeds
,
comments
,
iteration
,
position_in_batch
)
...
...
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