Skip to content

Instantly share code, notes, and snippets.

@camenduru
Last active January 24, 2025 09:24
Show Gist options
  • Save camenduru/9ec5f8141db9902e375967e93250860f to your computer and use it in GitHub Desktop.
Save camenduru/9ec5f8141db9902e375967e93250860f to your computer and use it in GitHub Desktop.
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)
@Little905
Copy link

Where should I place this document? When I put it under the scripts folder, there is no place to input the value of n in the interface. Help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment