Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,26 +72,18 @@ def Piper(_do,_dont):
|
|
| 72 |
height=480,
|
| 73 |
width=480,
|
| 74 |
negative_prompt=_dont,
|
| 75 |
-
num_inference_steps=
|
| 76 |
-
guidance_scale=
|
| 77 |
)
|
| 78 |
|
| 79 |
def infer(prompt1,prompt2,prompt3,prompt4):
|
| 80 |
name = generate_random_string(12)+".png"
|
| 81 |
|
| 82 |
if prompt4 == None:
|
| 83 |
-
|
| 84 |
else:
|
| 85 |
-
|
| 86 |
|
| 87 |
-
_dont = f'Any usage of text or logo{prompt5}!'
|
| 88 |
-
|
| 89 |
-
if prompt4 == None:
|
| 90 |
-
prompt6 = "text nor logos"
|
| 91 |
-
else:
|
| 92 |
-
prompt6 = "text nor logos nor " + " nor ".join([translate(v,"english") for v in prompt4])
|
| 93 |
-
|
| 94 |
-
|
| 95 |
if prompt1 == None:
|
| 96 |
prompt1 = "element"
|
| 97 |
else:
|
|
@@ -107,9 +99,9 @@ def infer(prompt1,prompt2,prompt3,prompt4):
|
|
| 107 |
else:
|
| 108 |
prompt3 = " ".join([translate(v,"english").upper() for v in prompt3]) + " event"
|
| 109 |
|
| 110 |
-
_do = f'Accuratly produce in a sensible way: {prompt3}, focusing on {prompt1},
|
| 111 |
|
| 112 |
-
image = Piper(_do,
|
| 113 |
return name
|
| 114 |
|
| 115 |
css="""
|
|
|
|
| 72 |
height=480,
|
| 73 |
width=480,
|
| 74 |
negative_prompt=_dont,
|
| 75 |
+
num_inference_steps=80,
|
| 76 |
+
guidance_scale=6
|
| 77 |
)
|
| 78 |
|
| 79 |
def infer(prompt1,prompt2,prompt3,prompt4):
|
| 80 |
name = generate_random_string(12)+".png"
|
| 81 |
|
| 82 |
if prompt4 == None:
|
| 83 |
+
prompt4 = "text and logos"
|
| 84 |
else:
|
| 85 |
+
prompt4 = "text and logos and " + " and ".join([translate(v,"english") for v in prompt4])
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
if prompt1 == None:
|
| 88 |
prompt1 = "element"
|
| 89 |
else:
|
|
|
|
| 99 |
else:
|
| 100 |
prompt3 = " ".join([translate(v,"english").upper() for v in prompt3]) + " event"
|
| 101 |
|
| 102 |
+
_do = f'Accuratly produce in a sensible way: {prompt3}, focusing on {prompt1}, including {prompt2}, excluding {prompt4}'
|
| 103 |
|
| 104 |
+
image = Piper(_do,prompt4).images[0].save(name)
|
| 105 |
return name
|
| 106 |
|
| 107 |
css="""
|