cedpsam commited on
Commit
3c39bfa
1 Parent(s): 252a108

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,7 +15,7 @@ def generate_img(prompt):
15
  return result
16
 
17
  def pollinations_url_seedless(a, width=512, height=512):
18
- urlprompt=quote(a)
19
  url=f"https://image.pollinations.ai/prompt/{urlprompt}?width={width}&height={height}"
20
  return url
21
 
@@ -35,7 +35,7 @@ def interrogate(img):
35
  def rountrip(img):
36
  prompt=interrogate(img)
37
  print(prompt)
38
- # url=pollinations_url_seedless(prompt)
39
  return generate_img(prompt),prompt
40
 
41
  demo = gr.Interface(rountrip, gr.Image(type= 'filepath'),[gr.Image(type= 'filepath'),"textbox"])
 
15
  return result
16
 
17
  def pollinations_url_seedless(a, width=512, height=512):
18
+ urlprompt=quote(a, errors="ignore")
19
  url=f"https://image.pollinations.ai/prompt/{urlprompt}?width={width}&height={height}"
20
  return url
21
 
 
35
  def rountrip(img):
36
  prompt=interrogate(img)
37
  print(prompt)
38
+ url=pollinations_url_seedless(prompt)
39
  return generate_img(prompt),prompt
40
 
41
  demo = gr.Interface(rountrip, gr.Image(type= 'filepath'),[gr.Image(type= 'filepath'),"textbox"])