GenAIJake commited on
Commit
848c9a0
·
verified ·
1 Parent(s): 5297371

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -7
app.py CHANGED
@@ -15,20 +15,32 @@ examples = [
15
  demo = gr.load("models/GenAIJake/d3xt3r")
16
 
17
  # Customize the interface
18
- with demo:
19
  gr.Markdown("# D3XT3R Dachshund Image Generator")
20
- gr.Examples(examples, inputs=demo.input_components)
21
 
22
- # Add LoRA scale slider
23
- lora_scale = gr.Slider(minimum=0.0, maximum=1.0, value=0.8, step=0.05, label="LoRA Influence")
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  # Update the generate button to include the lora_scale parameter
26
- demo.input_components[-1].click(
27
  fn=generate_image,
28
  inputs=demo.input_components + [lora_scale],
29
  outputs=demo.output_components
30
  )
31
 
32
  # Add GPUZero functionality
33
- demo.queue()
34
- demo.launch()
 
15
  demo = gr.load("models/GenAIJake/d3xt3r")
16
 
17
  # Customize the interface
18
+ with gr.Blocks() as new_demo:
19
  gr.Markdown("# D3XT3R Dachshund Image Generator")
 
20
 
21
+ with gr.Row():
22
+ with gr.Column():
23
+ for component in demo.input_components:
24
+ component.render()
25
+
26
+ # Add LoRA scale slider
27
+ lora_scale = gr.Slider(minimum=0.0, maximum=1.0, value=0.8, step=0.05, label="LoRA Influence")
28
+
29
+ generate_btn = gr.Button("Generate")
30
+
31
+ with gr.Column():
32
+ for component in demo.output_components:
33
+ component.render()
34
+
35
+ gr.Examples(examples, inputs=demo.input_components)
36
 
37
  # Update the generate button to include the lora_scale parameter
38
+ generate_btn.click(
39
  fn=generate_image,
40
  inputs=demo.input_components + [lora_scale],
41
  outputs=demo.output_components
42
  )
43
 
44
  # Add GPUZero functionality
45
+ new_demo.queue()
46
+ new_demo.launch()