Inzaniak / sd-webui-ranbooru

71 stars 7 forks source link

Post ID not working when batch count/size > 1 #37

Closed rktvr closed 1 month ago

rktvr commented 4 months ago

If you use the post ID search in ranbooru you will get this error in Forge (pre gradio 4, haven't updated yet) if you have a batch count and/or size larger than 1:

** Error running before_process: F:\stable-diffusion-webui-forge\extensions\sd-webui-ranbooru\scripts\ranbooru.py Traceback (most recent call last): File "F:\stable-diffusion-webui-forge\modules\scripts.py", line 795, in before_process script.before_process(p, script_args) File "F:\stable-diffusion-webui-forge\extensions\sd-webui-ranbooru\scripts\ranbooru.py", line 801, in before_process random_numbers = self.random_number(sorting_order, p.batch_size * p.n_iter) File "F:\stable-diffusion-webui-forge\extensions\sd-webui-ranbooru\scripts\ranbooru.py", line 1029, in random_number random_numbers = random.sample(range(COUNT), size) File "C:\python310\lib\random.py", line 482, in sample raise ValueError("Sample larger than population or is negative") ValueError: Sample larger than population or is negative