Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -215,9 +215,9 @@ def resize_to_fit(max_size, original_size):
|
|
| 215 |
|
| 216 |
def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg):
|
| 217 |
|
| 218 |
-
max_size = (
|
| 219 |
if prompt in prompt_list:
|
| 220 |
-
max_size = (
|
| 221 |
if isrmbg:
|
| 222 |
try:
|
| 223 |
rmbgfore = rmbg(fore)
|
|
@@ -235,7 +235,7 @@ def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg):
|
|
| 235 |
if size[0]*size[1]<=(768*768):
|
| 236 |
gr.Warning("ℹ️ The input image resolution is low, it might lead to some deformation!")
|
| 237 |
|
| 238 |
-
if size[0]*size[1]>(
|
| 239 |
gr.Warning("ℹ️ The input image size is too big, I will lower it!")
|
| 240 |
image_width, image_height = resize_to_fit((1500,1500), (image_width, image_height))
|
| 241 |
fore.resize(max_size)
|
|
|
|
| 215 |
|
| 216 |
def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg):
|
| 217 |
|
| 218 |
+
max_size = (1400,1400)
|
| 219 |
if prompt in prompt_list:
|
| 220 |
+
max_size = (1500,1500)
|
| 221 |
if isrmbg:
|
| 222 |
try:
|
| 223 |
rmbgfore = rmbg(fore)
|
|
|
|
| 235 |
if size[0]*size[1]<=(768*768):
|
| 236 |
gr.Warning("ℹ️ The input image resolution is low, it might lead to some deformation!")
|
| 237 |
|
| 238 |
+
if size[0]*size[1]>(max_size[0]*max_size[1]):
|
| 239 |
gr.Warning("ℹ️ The input image size is too big, I will lower it!")
|
| 240 |
image_width, image_height = resize_to_fit((1500,1500), (image_width, image_height))
|
| 241 |
fore.resize(max_size)
|