Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -80,28 +80,28 @@ def infer(prompt1,prompt2,prompt3,prompt4):
|
|
80 |
name = generate_random_string(12)+".png"
|
81 |
|
82 |
if prompt4 == None:
|
83 |
-
prompt4 = "
|
84 |
else:
|
85 |
-
prompt4 = "
|
86 |
|
87 |
prompt4 = prompt4.upper()
|
88 |
|
89 |
if prompt1 == None:
|
90 |
-
prompt1 = "
|
91 |
else:
|
92 |
-
prompt1 = ",
|
93 |
|
94 |
if prompt2 == None:
|
95 |
-
prompt2 =
|
96 |
else:
|
97 |
-
prompt2 = ",
|
98 |
|
99 |
if prompt3 == None:
|
100 |
-
prompt3 = "event"
|
101 |
else:
|
102 |
-
prompt3 = " ".join([translate(v,"english")
|
103 |
|
104 |
-
_do = f'
|
105 |
|
106 |
image = Piper(_do).images[0].save(name)
|
107 |
return name
|
|
|
80 |
name = generate_random_string(12)+".png"
|
81 |
|
82 |
if prompt4 == None:
|
83 |
+
prompt4 = " without text nor logo"
|
84 |
else:
|
85 |
+
prompt4 = " without text nor logo " + " nor ".join([translate(v,"english") for v in prompt4])
|
86 |
|
87 |
prompt4 = prompt4.upper()
|
88 |
|
89 |
if prompt1 == None:
|
90 |
+
prompt1 = "focused elements" + prompt4
|
91 |
else:
|
92 |
+
prompt1 = ", ".join([ "primary "+(translate(v,"english")+prompt4) for v in prompt1 ])
|
93 |
|
94 |
if prompt2 == None:
|
95 |
+
prompt2 = "secondary elements" + prompt4
|
96 |
else:
|
97 |
+
prompt2 = ", ".join([ "secondary "+(translate(v,"english")+prompt4) for v in prompt2 ])
|
98 |
|
99 |
if prompt3 == None:
|
100 |
+
prompt3 = "event" + prompt4
|
101 |
else:
|
102 |
+
prompt3 = ", ".join([ (translate(v,"english")+" "+prompt4) for v in prompt3 ])
|
103 |
|
104 |
+
_do = f'Rational fusion, from, {prompt3}, {prompt2}, {prompt1}'
|
105 |
|
106 |
image = Piper(_do).images[0].save(name)
|
107 |
return name
|