Skip to content

Commit cd88e21

Browse files
authored
Class Name typo and add descriptions to fields.
1 parent 8ae0ea9 commit cd88e21

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

modules/script_callbacks.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,22 @@ def __init__(self, image, p, filename, pnginfo):
2424
"""dictionary with parameters for image's PNG info data; infotext will have the key 'parameters'"""
2525

2626

27-
class CGFDenoiserParams:
28-
def __init__(self, x_in, image_cond_in, sigma_in, sampling_step, total_sampling_steps):
29-
self.x_in = x_in
30-
self.image_cond_in = image_cond_in
31-
self.sigma_in = sigma_in
27+
class CFGDenoiserParams:
28+
def __init__(self, x, image_cond, sigma, sampling_step, total_sampling_steps):
29+
self.x = x
30+
"""Latent image representation in the process of being denoised"""
31+
32+
self.image_cond = image_cond
33+
"""Conditioning image"""
34+
35+
self.sigma = sigma
36+
"""Current sigma noise step value"""
37+
3238
self.sampling_step = sampling_step
39+
"""Current Sampling step number"""
40+
3341
self.total_sampling_steps = total_sampling_steps
42+
"""Total number of sampling steps planned"""
3443

3544

3645
ScriptCallback = namedtuple("ScriptCallback", ["script", "callback"])
@@ -94,7 +103,7 @@ def image_saved_callback(params: ImageSaveParams):
94103
report_exception(c, 'image_saved_callback')
95104

96105

97-
def cfg_denoiser_callback(params: CGFDenoiserParams):
106+
def cfg_denoiser_callback(params: CFGDenoiserParams):
98107
for c in callbacks_cfg_denoiser:
99108
try:
100109
c.callback(params)
@@ -153,7 +162,7 @@ def on_image_saved(callback):
153162
def on_cfg_denoiser(callback):
154163
"""register a function to be called in the kdiffussion cfg_denoiser method after building the inner model inputs.
155164
The callback is called with one argument:
156-
- params: CGFDenoiserParams - parameters to be passed to the inner model and sampling state details.
165+
- params: CFGDenoiserParams - parameters to be passed to the inner model and sampling state details.
157166
"""
158167
add_callback(callbacks_cfg_denoiser, callback)
159168

0 commit comments

Comments
 (0)