DigiP-AI commited on
Commit
78539a4
·
verified ·
1 Parent(s): e7b5351

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -49,6 +49,9 @@ theme = gr.themes.Soft(
49
  API_TOKEN = os.getenv("HF_READ_TOKEN")
50
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
51
  timeout = 100
 
 
 
52
 
53
  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):
54
  if prompt == "" or prompt == None:
@@ -186,5 +189,12 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
186
 
187
  text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=[image_output, seed_output])
188
 
 
 
 
 
 
 
 
189
 
190
  app.launch(show_api=False, share=False)
 
49
  API_TOKEN = os.getenv("HF_READ_TOKEN")
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:
 
189
 
190
  text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=[image_output, seed_output])
191
 
192
+ with gr.Tab("Flip Image"):
193
+ with gr.Row():
194
+ image_input = gr.Image()
195
+ image_output = gr.Image(format="png")
196
+ with gr.Row():
197
+ image_button = gr.Button("Run", variant='primary')
198
+ image_button.click(flip_image, inputs=image_input, outputs=image_output)
199
 
200
  app.launch(show_api=False, share=False)