Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -77,16 +77,16 @@ 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=1024,
|
86 |
width=448,
|
87 |
-
num_inference_steps=
|
88 |
-
max_sequence_length=
|
89 |
-
guidance_scale=
|
90 |
)
|
91 |
return retu
|
92 |
except:
|
@@ -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 = 'beautiful playful photographed scene, highly detailed, realistic
|
99 |
else:
|
100 |
-
_do = f'{ prompt_en } beautiful playful
|
101 |
output = Piper(_do)
|
102 |
if output == "":
|
103 |
return output
|
|
|
77 |
characters = string.ascii_letters + string.digits
|
78 |
return ''.join(random.choice(characters) for _ in range(length))
|
79 |
|
80 |
+
@spaces.GPU(duration=40)
|
81 |
def Piper(_do):
|
82 |
try:
|
83 |
retu = pipe(
|
84 |
_do,
|
85 |
height=1024,
|
86 |
width=448,
|
87 |
+
num_inference_steps=20,
|
88 |
+
max_sequence_length=512,
|
89 |
+
guidance_scale=7
|
90 |
)
|
91 |
return retu
|
92 |
except:
|
|
|
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 elements, dynamic poze, deep field, vivid reasonable coloring, rough texture, high sharpness'
|
99 |
else:
|
100 |
+
_do = f'{ prompt_en }, beautiful playful photographed scene, highly detailed, realistic elements, dynamic poze, deep field, vivid reasonable coloring, rough texture, high sharpness'
|
101 |
output = Piper(_do)
|
102 |
if output == "":
|
103 |
return output
|