Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -50,6 +50,8 @@ API_TOKEN = os.getenv("HF_READ_TOKEN")
|
|
50 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
51 |
timeout = 100
|
52 |
|
|
|
|
|
53 |
|
54 |
def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=1024, height=1024):
|
55 |
if prompt == "" or prompt == None:
|
@@ -196,15 +198,13 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
196 |
|
197 |
text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=[image_output, seed_output])
|
198 |
|
199 |
-
with gr.Tab("Image
|
200 |
with gr.Row():
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
iface = gr.Interface(fn=upscale_image, inputs = [gr.Image(label="Input Image", interactive=True), radio_input], outputs = gr.Image(label="Upscaled Image", format="png"), title="Image Upscaler")
|
208 |
-
|
209 |
if __name__ == "__main__":
|
210 |
app.launch(show_api=False, share=False)
|
|
|
50 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
51 |
timeout = 100
|
52 |
|
53 |
+
def flip_image(x):
|
54 |
+
return np.fliplr(x)
|
55 |
|
56 |
def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=1024, height=1024):
|
57 |
if prompt == "" or prompt == None:
|
|
|
198 |
|
199 |
text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=[image_output, seed_output])
|
200 |
|
201 |
+
with gr.Tab("Flip Image"):
|
202 |
with gr.Row():
|
203 |
+
image_input = gr.Image()
|
204 |
+
image_output = gr.Image(format="png")
|
205 |
+
with gr.Row():
|
206 |
+
image_button = gr.Button("Run", variant='primary')
|
207 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
208 |
+
|
|
|
|
|
209 |
if __name__ == "__main__":
|
210 |
app.launch(show_api=False, share=False)
|