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
549b475b
Commit
549b475b
authored
Aug 29, 2023
by
catboxanon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add noisy latent to ExtraNoiseParams for callback
parent
04b90328
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
modules/script_callbacks.py
modules/script_callbacks.py
+5
-2
modules/sd_samplers_kdiffusion.py
modules/sd_samplers_kdiffusion.py
+1
-1
modules/sd_samplers_timesteps.py
modules/sd_samplers_timesteps.py
+1
-1
No files found.
modules/script_callbacks.py
View file @
549b475b
...
@@ -29,12 +29,15 @@ class ImageSaveParams:
...
@@ -29,12 +29,15 @@ class ImageSaveParams:
class
ExtraNoiseParams
:
class
ExtraNoiseParams
:
def
__init__
(
self
,
noise
,
x
):
def
__init__
(
self
,
noise
,
x
,
xi
):
self
.
noise
=
noise
self
.
noise
=
noise
"""Random noise generated by the seed"""
"""Random noise generated by the seed"""
self
.
x
=
x
self
.
x
=
x
"""Latent image representation of the image"""
"""Latent representation of the image"""
self
.
xi
=
xi
"""Noisy latent representation of the image"""
class
CFGDenoiserParams
:
class
CFGDenoiserParams
:
...
...
modules/sd_samplers_kdiffusion.py
View file @
549b475b
...
@@ -148,7 +148,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
...
@@ -148,7 +148,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
if
opts
.
img2img_extra_noise
>
0
:
if
opts
.
img2img_extra_noise
>
0
:
p
.
extra_generation_params
[
"Extra noise"
]
=
opts
.
img2img_extra_noise
p
.
extra_generation_params
[
"Extra noise"
]
=
opts
.
img2img_extra_noise
extra_noise_params
=
ExtraNoiseParams
(
noise
,
x
)
extra_noise_params
=
ExtraNoiseParams
(
noise
,
x
,
xi
)
extra_noise_callback
(
extra_noise_params
)
extra_noise_callback
(
extra_noise_params
)
noise
=
extra_noise_params
.
noise
noise
=
extra_noise_params
.
noise
xi
+=
noise
*
opts
.
img2img_extra_noise
xi
+=
noise
*
opts
.
img2img_extra_noise
...
...
modules/sd_samplers_timesteps.py
View file @
549b475b
...
@@ -107,7 +107,7 @@ class CompVisSampler(sd_samplers_common.Sampler):
...
@@ -107,7 +107,7 @@ class CompVisSampler(sd_samplers_common.Sampler):
if
opts
.
img2img_extra_noise
>
0
:
if
opts
.
img2img_extra_noise
>
0
:
p
.
extra_generation_params
[
"Extra noise"
]
=
opts
.
img2img_extra_noise
p
.
extra_generation_params
[
"Extra noise"
]
=
opts
.
img2img_extra_noise
extra_noise_params
=
ExtraNoiseParams
(
noise
,
x
)
extra_noise_params
=
ExtraNoiseParams
(
noise
,
x
,
xi
)
extra_noise_callback
(
extra_noise_params
)
extra_noise_callback
(
extra_noise_params
)
noise
=
extra_noise_params
.
noise
noise
=
extra_noise_params
.
noise
xi
+=
noise
*
opts
.
img2img_extra_noise
*
sqrt_alpha_cumprod
xi
+=
noise
*
opts
.
img2img_extra_noise
*
sqrt_alpha_cumprod
...
...
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