Omnibus commited on
Commit
191a8da
1 Parent(s): c231804

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -85,12 +85,17 @@ def process_vid(file,cur_frame,every_n):
85
  return (gr.HTML('No frame matches found.'),"","")
86
 
87
  def process_im(file):
88
- read_file = Image.open(file)
89
- read_file.save(f"{uid}-tmp.png")
90
- action_input = f"{uid}-tmp.png"
91
- out = os.path.abspath(action_input)
92
- out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
93
- return (out_url)
 
 
 
 
 
94
 
95
  def rev_im(image_url):
96
  #image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'
 
85
  return (gr.HTML('No frame matches found.'),"","")
86
 
87
  def process_im(file):
88
+ if file.startswith("https://"):
89
+ return file
90
+ if file.startswith("http://"):
91
+ return file
92
+ else:
93
+ read_file = Image.open(file)
94
+ read_file.save(f"{uid}-tmp.png")
95
+ action_input = f"{uid}-tmp.png"
96
+ out = os.path.abspath(action_input)
97
+ out_url = f'https://omnibus-reverse-image.hf.space/file={out}'
98
+ return (out_url)
99
 
100
  def rev_im(image_url):
101
  #image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'