diff --git a/gradio_app.py b/gradio_app.py index d0eecd8..1f8e4ab 100644 --- a/gradio_app.py +++ b/gradio_app.py @@ -31,7 +31,11 @@ from transformers.generation.stopping_criteria import StoppingCriteriaList import lib_omost.canvas as omost_canvas +import random +# Function to generate a random seed +def generate_random_seed(): + return random.randint(0, 2**31 - 1) # SDXL @@ -302,7 +306,8 @@ def diffusion_fn(chatbot, canvas_outputs, num_samples, seed, image_width, image_ undo_btn = gr.Button("✏️️ Edit Last Input", variant="secondary", size="sm", min_width=60, interactive=False) seed = gr.Number(label="Random Seed", value=12345, precision=0) - + random_seed_btn = gr.Button("Generate Random Seed", variant="secondary", size="sm", min_width=60) + random_seed_btn.click(fn=generate_random_seed, outputs=seed) with gr.Accordion(open=True, label='Language Model'): with gr.Group(): with gr.Row():