File size: 786 Bytes
0533e7c
21d47c1
0533e7c
21d47c1
 
 
 
 
92c0155
21d47c1
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
import random  # Import random module for generating random seeds

# Function to generate a random seed if the given seed is -1
def generate_seed(seed):
    if seed == -1:
        return random.randint(0, 999999999)
    return seed

# Define the interface
seed_input = gr.components.Number(label="Seed (Set to -1 for random seed)", default=-1, step=1, min=-1)
def generate_output(seed):
    seed = generate_seed(seed)
    return {"Generated Seed": seed}

# Load the model (assuming the model file is present in the specified path)
model_interface = gr.load("models/Linaqruf/anything-v3.0")

# Combine the interfaces and launch the model interface
model_interface.inputs = [seed_input] + model_interface.inputs
model_interface.launch(enable_queue=False, share=False)