Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button to randomize seed #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion gradio_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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():
Expand Down