Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -77,14 +77,14 @@ def generate_random_string(length):
|
|
77 |
characters = string.ascii_letters + string.digits
|
78 |
return ''.join(random.choice(characters) for _ in range(length))
|
79 |
|
80 |
-
@spaces.GPU(duration=
|
81 |
def Piper(_do):
|
82 |
try:
|
83 |
retu = pipe(
|
84 |
_do,
|
85 |
-
height=
|
86 |
-
width=
|
87 |
-
num_inference_steps=
|
88 |
max_sequence_length=256,
|
89 |
guidance_scale=2
|
90 |
)
|
@@ -95,9 +95,9 @@ def Piper(_do):
|
|
95 |
def infer(prompt_en):
|
96 |
name = generate_random_string(12)+".png"
|
97 |
if prompt_en == "":
|
98 |
-
_do = 'photographed scene, highly detailed, realistic content, dynamic poze, deep field, natural
|
99 |
else:
|
100 |
-
_do = f'{ prompt_en } photograph, highly detailed, realistic content, dynamic poze, deep field, natural
|
101 |
output = Piper(_do)
|
102 |
if output == "":
|
103 |
return output
|
@@ -126,7 +126,7 @@ footer {
|
|
126 |
max-width: 15cm !important;
|
127 |
}
|
128 |
.image-container {
|
129 |
-
aspect-ratio:
|
130 |
}
|
131 |
.dropdown-arrow {
|
132 |
display: none !important;
|
@@ -161,7 +161,7 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
|
|
161 |
with gr.Row():
|
162 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
163 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
164 |
-
|
165 |
def _ret(idx,p1):
|
166 |
print(f'Starting {idx}: {p1}')
|
167 |
v = infer(p1)
|
|
|
77 |
characters = string.ascii_letters + string.digits
|
78 |
return ''.join(random.choice(characters) for _ in range(length))
|
79 |
|
80 |
+
@spaces.GPU(duration=35)
|
81 |
def Piper(_do):
|
82 |
try:
|
83 |
retu = pipe(
|
84 |
_do,
|
85 |
+
height=1024,
|
86 |
+
width=448,
|
87 |
+
num_inference_steps=10,
|
88 |
max_sequence_length=256,
|
89 |
guidance_scale=2
|
90 |
)
|
|
|
95 |
def infer(prompt_en):
|
96 |
name = generate_random_string(12)+".png"
|
97 |
if prompt_en == "":
|
98 |
+
_do = 'beautiful playful photographed scene, highly detailed, realistic content, dynamic poze, deep field, natural coloring, rough texture, sharp presentation'
|
99 |
else:
|
100 |
+
_do = f'{ prompt_en } beautiful playful photograph, highly detailed, realistic content, dynamic poze, deep field, natural coloring, rough texture, sharp presentation'
|
101 |
output = Piper(_do)
|
102 |
if output == "":
|
103 |
return output
|
|
|
126 |
max-width: 15cm !important;
|
127 |
}
|
128 |
.image-container {
|
129 |
+
aspect-ratio: 448 / 1024 !important;
|
130 |
}
|
131 |
.dropdown-arrow {
|
132 |
display: none !important;
|
|
|
161 |
with gr.Row():
|
162 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
163 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
164 |
+
|
165 |
def _ret(idx,p1):
|
166 |
print(f'Starting {idx}: {p1}')
|
167 |
v = infer(p1)
|