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
aa744cad
Commit
aa744cad
authored
Aug 05, 2023
by
Kohaku-Blueleaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add infotext
parent
9ac2989e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
modules/generation_parameters_copypaste.py
modules/generation_parameters_copypaste.py
+8
-0
modules/processing.py
modules/processing.py
+3
-0
No files found.
modules/generation_parameters_copypaste.py
View file @
aa744cad
...
@@ -304,6 +304,12 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
...
@@ -304,6 +304,12 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
if
"Schedule rho"
not
in
res
:
if
"Schedule rho"
not
in
res
:
res
[
"Schedule rho"
]
=
0
res
[
"Schedule rho"
]
=
0
if
"VAE Encoder"
not
in
res
:
res
[
"VAE Encoder"
]
=
"Full"
if
"VAE Decoder"
not
in
res
:
res
[
"VAE Decoder"
]
=
"Full"
return
res
return
res
...
@@ -329,6 +335,8 @@ infotext_to_setting_name_mapping = [
...
@@ -329,6 +335,8 @@ infotext_to_setting_name_mapping = [
(
'RNG'
,
'randn_source'
),
(
'RNG'
,
'randn_source'
),
(
'NGMS'
,
's_min_uncond'
),
(
'NGMS'
,
's_min_uncond'
),
(
'Pad conds'
,
'pad_cond_uncond'
),
(
'Pad conds'
,
'pad_cond_uncond'
),
(
'VAE Encoder'
,
'sd_vae_encode_method'
),
(
'VAE Decoder'
,
'sd_vae_decode_method'
),
]
]
...
...
modules/processing.py
View file @
aa744cad
...
@@ -788,6 +788,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
...
@@ -788,6 +788,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
with
devices
.
without_autocast
()
if
devices
.
unet_needs_upcast
else
devices
.
autocast
():
with
devices
.
without_autocast
()
if
devices
.
unet_needs_upcast
else
devices
.
autocast
():
samples_ddim
=
p
.
sample
(
conditioning
=
p
.
c
,
unconditional_conditioning
=
p
.
uc
,
seeds
=
p
.
seeds
,
subseeds
=
p
.
subseeds
,
subseed_strength
=
p
.
subseed_strength
,
prompts
=
p
.
prompts
)
samples_ddim
=
p
.
sample
(
conditioning
=
p
.
c
,
unconditional_conditioning
=
p
.
uc
,
seeds
=
p
.
seeds
,
subseeds
=
p
.
subseeds
,
subseed_strength
=
p
.
subseed_strength
,
prompts
=
p
.
prompts
)
p
.
extra_generation_params
[
'VAE Decoder'
]
=
opts
.
sd_vae_decode_method
x_samples_ddim
=
decode_latent_batch
(
p
.
sd_model
,
samples_ddim
,
target_device
=
devices
.
cpu
,
check_for_nans
=
True
)
x_samples_ddim
=
decode_latent_batch
(
p
.
sd_model
,
samples_ddim
,
target_device
=
devices
.
cpu
,
check_for_nans
=
True
)
x_samples_ddim
=
torch
.
stack
(
x_samples_ddim
)
.
float
()
x_samples_ddim
=
torch
.
stack
(
x_samples_ddim
)
.
float
()
x_samples_ddim
=
torch
.
clamp
((
x_samples_ddim
+
1.0
)
/
2.0
,
min
=
0.0
,
max
=
1.0
)
x_samples_ddim
=
torch
.
clamp
((
x_samples_ddim
+
1.0
)
/
2.0
,
min
=
0.0
,
max
=
1.0
)
...
@@ -1100,6 +1101,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
...
@@ -1100,6 +1101,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
decoded_samples
=
torch
.
from_numpy
(
np
.
array
(
batch_images
))
decoded_samples
=
torch
.
from_numpy
(
np
.
array
(
batch_images
))
decoded_samples
=
decoded_samples
.
to
(
shared
.
device
)
decoded_samples
=
decoded_samples
.
to
(
shared
.
device
)
self
.
extra_generation_params
[
'VAE Encoder'
]
=
opts
.
sd_vae_encode_method
samples
=
images_tensor_to_samples
(
decoded_samples
,
approximation_indexes
.
get
(
opts
.
sd_vae_encode_method
))
samples
=
images_tensor_to_samples
(
decoded_samples
,
approximation_indexes
.
get
(
opts
.
sd_vae_encode_method
))
image_conditioning
=
self
.
img2img_image_conditioning
(
decoded_samples
,
samples
)
image_conditioning
=
self
.
img2img_image_conditioning
(
decoded_samples
,
samples
)
...
@@ -1338,6 +1340,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
...
@@ -1338,6 +1340,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
raise
RuntimeError
(
f
"bad number of images passed: {len(imgs)}; expecting {self.batch_size} or less"
)
raise
RuntimeError
(
f
"bad number of images passed: {len(imgs)}; expecting {self.batch_size} or less"
)
image
=
torch
.
from_numpy
(
batch_images
)
image
=
torch
.
from_numpy
(
batch_images
)
self
.
extra_generation_params
[
'VAE Encoder'
]
=
opts
.
sd_vae_encode_method
self
.
init_latent
=
images_tensor_to_samples
(
image
,
approximation_indexes
.
get
(
opts
.
sd_vae_encode_method
),
self
.
sd_model
)
self
.
init_latent
=
images_tensor_to_samples
(
image
,
approximation_indexes
.
get
(
opts
.
sd_vae_encode_method
),
self
.
sd_model
)
devices
.
torch_gc
()
devices
.
torch_gc
()
...
...
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