Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ lora_path = "OedoSoldier/detail-tweaker-lora"
|
|
8 |
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse").to("cuda")
|
9 |
|
10 |
@spaces.GPU
|
11 |
-
def generate_image(prompt, negative_prompt, num_inference_steps=30, guidance_scale=7.0,model="Real6.0",
|
12 |
|
13 |
if model == "Real5.0":
|
14 |
model_id = "SG161222/Realistic_Vision_V5.0_noVAE"
|
@@ -73,7 +73,7 @@ with gr.Blocks() as demo:
|
|
73 |
value="Real6.0",
|
74 |
label="Model",
|
75 |
)
|
76 |
-
|
77 |
minimum=1,
|
78 |
maximum=4,
|
79 |
value=1,
|
@@ -108,7 +108,7 @@ with gr.Blocks() as demo:
|
|
108 |
# Connect the interface to the generation function
|
109 |
generate_button.click(
|
110 |
fn=generate_image,
|
111 |
-
inputs=[prompt, negative_prompt, steps_slider, guidance_slider, model,
|
112 |
outputs=gallery
|
113 |
)
|
114 |
|
|
|
8 |
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse").to("cuda")
|
9 |
|
10 |
@spaces.GPU
|
11 |
+
def generate_image(prompt, negative_prompt, num_inference_steps=30, guidance_scale=7.0,model="Real6.0",num_images=1):
|
12 |
|
13 |
if model == "Real5.0":
|
14 |
model_id = "SG161222/Realistic_Vision_V5.0_noVAE"
|
|
|
73 |
value="Real6.0",
|
74 |
label="Model",
|
75 |
)
|
76 |
+
num_images = gr.Slider( # New slider for number of images
|
77 |
minimum=1,
|
78 |
maximum=4,
|
79 |
value=1,
|
|
|
108 |
# Connect the interface to the generation function
|
109 |
generate_button.click(
|
110 |
fn=generate_image,
|
111 |
+
inputs=[prompt, negative_prompt, steps_slider, guidance_slider, model, num_images],
|
112 |
outputs=gallery
|
113 |
)
|
114 |
|