Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import spaces
|
3 |
|
4 |
@spaces.GPU
|
5 |
-
def generate_image(prompt, negative_prompt="", seed=42, width=512, height=512, guidance_scale=3.5, num_inference_steps=20):
|
6 |
# This function will be called by gr.load(), so we don't need to implement it here
|
7 |
pass
|
8 |
|
@@ -18,6 +18,16 @@ demo = gr.load("models/GenAIJake/d3xt3r")
|
|
18 |
with demo:
|
19 |
gr.Markdown("# D3XT3R Dachshund Image Generator")
|
20 |
gr.Examples(examples, inputs=demo.input_components)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
# Add GPUZero functionality
|
23 |
demo.queue()
|
|
|
2 |
import spaces
|
3 |
|
4 |
@spaces.GPU
|
5 |
+
def generate_image(prompt, negative_prompt="", seed=42, width=512, height=512, guidance_scale=3.5, num_inference_steps=20, lora_scale=0.8):
|
6 |
# This function will be called by gr.load(), so we don't need to implement it here
|
7 |
pass
|
8 |
|
|
|
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()
|