Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
52 |
timeout = 100
|
53 |
|
54 |
|
55 |
-
def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, num_images_per_prompt
|
56 |
if prompt == "" or prompt == None:
|
57 |
return None
|
58 |
|
@@ -86,7 +86,7 @@ def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler=
|
|
86 |
"cfg_scale": cfg_scale,
|
87 |
"seed": seed if seed != -1 else random.randint(1, 1000000000),
|
88 |
"strength": strength,
|
89 |
-
"num_images_per_prompt":
|
90 |
"parameters": {
|
91 |
"width": width, # Pass the width to the API
|
92 |
"height": height # Pass the height to the API
|
@@ -190,7 +190,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
190 |
inputs = [text_prompt],
|
191 |
)
|
192 |
|
193 |
-
text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, num_images_per_prompt, method, seed,
|
194 |
|
195 |
with gr.Tab("Image Upscaler"):
|
196 |
with gr.Row():
|
|
|
52 |
timeout = 100
|
53 |
|
54 |
|
55 |
+
def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, num_images_per_prompt=1, strength=0.7, width=1024, height=1024):
|
56 |
if prompt == "" or prompt == None:
|
57 |
return None
|
58 |
|
|
|
86 |
"cfg_scale": cfg_scale,
|
87 |
"seed": seed if seed != -1 else random.randint(1, 1000000000),
|
88 |
"strength": strength,
|
89 |
+
"num_images_per_prompt": num_images_per_prompt,
|
90 |
"parameters": {
|
91 |
"width": width, # Pass the width to the API
|
92 |
"height": height # Pass the height to the API
|
|
|
190 |
inputs = [text_prompt],
|
191 |
)
|
192 |
|
193 |
+
text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, num_images_per_prompt, method, seed, strength, width, height], outputs=[image_output, seed_output])
|
194 |
|
195 |
with gr.Tab("Image Upscaler"):
|
196 |
with gr.Row():
|