Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -86,14 +86,14 @@ def generate_random_string(length):
|
|
86 |
characters = string.ascii_letters + string.digits
|
87 |
return ''.join(random.choice(characters) for _ in range(length))
|
88 |
|
89 |
-
@spaces.GPU(duration=
|
90 |
def Piper(_do,_dont):
|
91 |
return pipe(
|
92 |
_do,
|
93 |
height=512,
|
94 |
-
width=
|
95 |
negative_prompt=_dont,
|
96 |
-
num_inference_steps=
|
97 |
guidance_scale=2
|
98 |
)
|
99 |
|
@@ -102,13 +102,13 @@ def infer(prompt,prompt2):
|
|
102 |
prompt_en = translate(prompt,"english")
|
103 |
prompt2_en = translate(prompt2,"english")
|
104 |
if prompt == None or prompt.strip() == "":
|
105 |
-
_do = 'realistic natural sharp light vivid vintage coloring'
|
106 |
else:
|
107 |
-
_do = f'realistic natural sharp light vivid vintage { prompt_en } reasonable scene coloring'
|
108 |
if prompt2 == None or prompt2.strip() == "":
|
109 |
-
_dont = 'smooth texture, fictional proportions, blurred
|
110 |
else:
|
111 |
-
_dont = f'{prompt2_en} where in {prompt_en}, smooth texture, fictional proportions, blurred
|
112 |
image = Piper(_do,_dont).images[0].save(name)
|
113 |
return name
|
114 |
|
@@ -133,7 +133,7 @@ footer {
|
|
133 |
max-width: 15cm !important;
|
134 |
}
|
135 |
#image-container {
|
136 |
-
aspect-ratio:
|
137 |
}
|
138 |
.dropdown-arrow {
|
139 |
display: none !important;
|
|
|
86 |
characters = string.ascii_letters + string.digits
|
87 |
return ''.join(random.choice(characters) for _ in range(length))
|
88 |
|
89 |
+
@spaces.GPU(duration=55)
|
90 |
def Piper(_do,_dont):
|
91 |
return pipe(
|
92 |
_do,
|
93 |
height=512,
|
94 |
+
width=768,
|
95 |
negative_prompt=_dont,
|
96 |
+
num_inference_steps=200,
|
97 |
guidance_scale=2
|
98 |
)
|
99 |
|
|
|
102 |
prompt_en = translate(prompt,"english")
|
103 |
prompt2_en = translate(prompt2,"english")
|
104 |
if prompt == None or prompt.strip() == "":
|
105 |
+
_do = 'realistic natural sharp light vivid vintage amazing yet reasonable scene coloring'
|
106 |
else:
|
107 |
+
_do = f'realistic natural sharp light vivid vintage { prompt_en } amazing yet reasonable scene coloring'
|
108 |
if prompt2 == None or prompt2.strip() == "":
|
109 |
+
_dont = 'smooth texture, fictional proportions, blurred content, distorted items, deformed palms, logos and signs, texts and prints'
|
110 |
else:
|
111 |
+
_dont = f'{prompt2_en} where in {prompt_en}, smooth texture, fictional proportions, blurred content, distorted items, deformed palms, logos and signs, texts and prints'
|
112 |
image = Piper(_do,_dont).images[0].save(name)
|
113 |
return name
|
114 |
|
|
|
133 |
max-width: 15cm !important;
|
134 |
}
|
135 |
#image-container {
|
136 |
+
aspect-ratio: 768 / 512 !important;
|
137 |
}
|
138 |
.dropdown-arrow {
|
139 |
display: none !important;
|