Skip to content

Commit

Permalink
Added seed widget in WAS_Load_Image_Batch node.
Browse files Browse the repository at this point in the history
  • Loading branch information
qirtn committed Oct 26, 2024
1 parent b2f1238 commit a356456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion WAS_Node_Suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -5270,6 +5270,7 @@ def INPUT_TYPES(cls):
return {
"required": {
"mode": (["single_image", "incremental_image", "random"],),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
"index": ("INT", {"default": 0, "min": 0, "max": 150000, "step": 1}),
"label": ("STRING", {"default": 'Batch 001', "multiline": False}),
"path": ("STRING", {"default": '', "multiline": False}),
Expand All @@ -5287,7 +5288,7 @@ def INPUT_TYPES(cls):

CATEGORY = "WAS Suite/IO"

def load_batch_images(self, path, pattern='*', index=0, mode="single_image", label='Batch 001', allow_RGBA_output='false', filename_text_extension='true'):
def load_batch_images(self, path, pattern='*', index=0, mode="single_image", seed=0, label='Batch 001', allow_RGBA_output='false', filename_text_extension='true'):

allow_RGBA_output = (allow_RGBA_output == 'true')

Expand All @@ -5306,6 +5307,7 @@ def load_batch_images(self, path, pattern='*', index=0, mode="single_image", lab
cstr(f"No valid image was found for the next ID. Did you remove images from the source directory?").error.print()
return (None, None)
else:
random.seed(seed)
newindex = int(random.random() * len(fl.image_paths))
image, filename = fl.get_image_by_id(newindex)
if image == None:
Expand Down

0 comments on commit a356456

Please sign in to comment.