Update app.py
Browse files
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 |
-
|
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"])
|