From c98c94125ec14db3478307baf562704ff43a9beb Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sat, 15 Jun 2024 01:29:41 +0300 Subject: [PATCH] Update nodes.py --- nodes/nodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nodes/nodes.py b/nodes/nodes.py index 07fe0f2..1482558 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -1668,6 +1668,7 @@ class CheckpointPerturbWeights: "joint_blocks": ("FLOAT", {"default": 0.02, "min": 0.001, "max": 10.0, "step": 0.001}), "final_layer": ("FLOAT", {"default": 0.02, "min": 0.001, "max": 10.0, "step": 0.001}), "rest_of_the_blocks": ("FLOAT", {"default": 0.02, "min": 0.001, "max": 10.0, "step": 0.001}), + "seed": ("INT", {"default": 123,"min": 0, "max": 0xffffffffffffffff, "step": 1}), } } RETURN_TYPES = ("MODEL",) @@ -1676,8 +1677,10 @@ class CheckpointPerturbWeights: CATEGORY = "KJNodes/experimental" - def mod(self, model, joint_blocks, final_layer, rest_of_the_blocks): + def mod(self, seed, model, joint_blocks, final_layer, rest_of_the_blocks): import copy + torch.manual_seed(seed) + torch.cuda.manual_seed_all(seed) device = model_management.get_torch_device() model_copy = copy.deepcopy(model) model_copy.model.to(device)