Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -75,11 +75,11 @@ def generate_random_string(length):
|
|
75 |
def Piper(_do,_dont):
|
76 |
return pipe(
|
77 |
_do,
|
78 |
-
height=
|
79 |
-
width=
|
80 |
negative_prompt=_dont,
|
81 |
num_inference_steps=400,
|
82 |
-
guidance_scale=
|
83 |
)
|
84 |
|
85 |
def infer(prompt,prompt2):
|
@@ -87,13 +87,13 @@ def infer(prompt,prompt2):
|
|
87 |
prompt_en = translate(prompt,"english")
|
88 |
prompt2_en = translate(prompt2,"english")
|
89 |
if prompt == None or prompt.strip() == "":
|
90 |
-
_do = 'natural colors, rough texture, proportional
|
91 |
else:
|
92 |
-
_do = f'{ prompt_en }, natural colors, rough texture, proportional
|
93 |
if prompt2 == None or prompt2.strip() == "":
|
94 |
-
_dont = 'ugly, deformed, inflated, disfigured, poor details, bad anatomy,
|
95 |
else:
|
96 |
-
_dont = f'ugly, deformed, inflated, disfigured, poor details, bad anatomy,
|
97 |
image = Piper(_do,_dont).images[0].save(name)
|
98 |
return name
|
99 |
|
@@ -101,9 +101,10 @@ css="""
|
|
101 |
#col-container {
|
102 |
margin: 0 auto;
|
103 |
max-width: 15cm;
|
|
|
104 |
}
|
105 |
#image-container {
|
106 |
-
aspect-ratio:
|
107 |
}
|
108 |
.dropdown-arrow {
|
109 |
display: none !important;
|
@@ -112,8 +113,8 @@ css="""
|
|
112 |
|
113 |
js="""
|
114 |
function custom(){
|
115 |
-
document.querySelector("div#prompt input").setAttribute("maxlength","
|
116 |
-
document.querySelector("div#prompt2 input").setAttribute("maxlength","
|
117 |
}
|
118 |
"""
|
119 |
|
|
|
75 |
def Piper(_do,_dont):
|
76 |
return pipe(
|
77 |
_do,
|
78 |
+
height=704,
|
79 |
+
width=528,
|
80 |
negative_prompt=_dont,
|
81 |
num_inference_steps=400,
|
82 |
+
guidance_scale=10
|
83 |
)
|
84 |
|
85 |
def infer(prompt,prompt2):
|
|
|
87 |
prompt_en = translate(prompt,"english")
|
88 |
prompt2_en = translate(prompt2,"english")
|
89 |
if prompt == None or prompt.strip() == "":
|
90 |
+
_do = 'natural deep warm colors, rough texture, proportional structure, dynamic poze, realistic details, award winning photograph, soft natural lighting, deep field, high definition, highly detailed, cold muted pastel background'
|
91 |
else:
|
92 |
+
_do = f'{ prompt_en }, natural deep warm colors, rough texture, proportional structure, dynamic poze, realistic details, award winning photograph, soft natural lighting, deep field, high definition, highly detailed, cold muted pastel background'
|
93 |
if prompt2 == None or prompt2.strip() == "":
|
94 |
+
_dont = 'ugly, deformed, inflated, disfigured, poor details, bad anatomy, logos, texts, any labels'
|
95 |
else:
|
96 |
+
_dont = f'ugly, deformed, inflated, disfigured, poor details, bad anatomy, logos, text, any labels, {prompt2_en}, in the {prompt_en}, out of the {prompt2_en}'
|
97 |
image = Piper(_do,_dont).images[0].save(name)
|
98 |
return name
|
99 |
|
|
|
101 |
#col-container {
|
102 |
margin: 0 auto;
|
103 |
max-width: 15cm;
|
104 |
+
max-height: 80vh;
|
105 |
}
|
106 |
#image-container {
|
107 |
+
aspect-ratio: 3 / 4;
|
108 |
}
|
109 |
.dropdown-arrow {
|
110 |
display: none !important;
|
|
|
113 |
|
114 |
js="""
|
115 |
function custom(){
|
116 |
+
document.querySelector("div#prompt input").setAttribute("maxlength","32");
|
117 |
+
document.querySelector("div#prompt2 input").setAttribute("maxlength","16");
|
118 |
}
|
119 |
"""
|
120 |
|