Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ def randn_like(cond, generator=None):
class CADS:
current_step = 0

@classmethod
def IS_CHANGED(*args, **kwargs):
return float("nan")

@classmethod
def INPUT_TYPES(s):
return {
Expand All @@ -25,6 +21,7 @@ def INPUT_TYPES(s):
"noise_scale": ("FLOAT", {"min": 0.0, "max": 1.0, "step": 0.01, "default": 0.25}),
"t1": ("FLOAT", {"min": 0.0, "max": 1.0, "step": 0.01, "default": 0.6}),
"t2": ("FLOAT", {"min": 0.0, "max": 1.0, "step": 0.01, "default": 0.9}),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff})
},
"optional": {
"rescale": ("FLOAT", {"min": 0.0, "max": 1.0, "step": 0.01, "default": 0.0}),
Expand All @@ -40,11 +37,12 @@ def INPUT_TYPES(s):

CATEGORY = "utils"

def do(self, model, noise_scale, t1, t2, rescale=0.0, start_step=-1, total_steps=-1, apply_to="both", key="y"):
def do(self, model, noise_scale, t1, t2, seed, rescale=0.0, start_step=-1, total_steps=-1, apply_to="both", key="y"):
previous_wrapper = model.model_options.get("model_function_wrapper")

im = model.model.model_sampling
CADS.current_step = start_step
generator = torch.Generator(device="cpu").manual_seed(seed)

skip = None
if apply_to == "cond":
Expand Down Expand Up @@ -72,7 +70,7 @@ def cads_noise(gamma, y):
if y is None:
return None
s = noise_scale
noise = randn_like(y)
noise = randn_like(y, generator=generator)
gamma = torch.tensor(gamma).to(y)
psi = rescale
if psi > 0:
Expand Down