Deniel Dimitrov commited on
Commit
a061b24
·
1 Parent(s): 21d47c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -7,15 +7,20 @@ def generate_seed(seed):
7
  return random.randint(0, 999999999)
8
  return seed
9
 
10
- # Define the interface
11
  seed_input = gr.components.Number(label="Seed (Set to -1 for random seed)", default=-1, step=1, min=-1)
12
  def generate_output(seed):
13
  seed = generate_seed(seed)
14
  return {"Generated Seed": seed}
15
 
16
  # Load the model (assuming the model file is present in the specified path)
17
- model_interface = gr.load("models/Linaqruf/anything-v3.0")
18
 
19
- # Combine the interfaces and launch the model interface
20
- model_interface.inputs = [seed_input] + model_interface.inputs
21
- model_interface.launch(enable_queue=False, share=False)
 
 
 
 
 
 
7
  return random.randint(0, 999999999)
8
  return seed
9
 
10
+ # Create a seed input component
11
  seed_input = gr.components.Number(label="Seed (Set to -1 for random seed)", default=-1, step=1, min=-1)
12
  def generate_output(seed):
13
  seed = generate_seed(seed)
14
  return {"Generated Seed": seed}
15
 
16
  # Load the model (assuming the model file is present in the specified path)
17
+ model_interface = gr.Interface.load("models/Linaqruf/anything-v3.0")
18
 
19
+ # Create a combined interface
20
+ combined_interface = gr.Interface(fn=generate_output, inputs=seed_input, outputs="text")
21
+
22
+ # Combine the interfaces
23
+ combined_interface.layout([seed_input, model_interface])
24
+
25
+ # Launch the combined interface
26
+ combined_interface.launch(enable_queue=False, share=False)