File size: 533 Bytes
fee99f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import math
import os
import sys
import traceback

import modules.scripts as scripts
import gradio as gr

from modules.processing import Processed, process_images

class Script(scripts.Script):
    def title(self):
        return "Run n times"

    def ui(self, is_img2img):
        n = gr.Textbox(label="n")
        return [n]

    def run(self, p, n):
        for x in range(int(n)):
            p.seed = -1
            proc = process_images(p)
            image = proc.images
        return Processed(p, image, p.seed, proc.info)