Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
comdoleger
commited on
Commit
•
75d43d9
1
Parent(s):
8cf2ff4
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)
|
@@ -237,7 +237,7 @@ def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg):
|
|
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((
|
241 |
fore.resize(max_size)
|
242 |
|
243 |
|
@@ -249,8 +249,8 @@ def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg):
|
|
249 |
"prompt" : prompt,
|
250 |
"mode" : mode,
|
251 |
"intensity" : float(intensity),
|
252 |
-
"width" :
|
253 |
-
"height" :
|
254 |
"refprompt" : refprompt
|
255 |
}
|
256 |
#print(f"DATA: {data}")
|
|
|
215 |
|
216 |
def process_generate(fore, prompt, intensity, mode, refprompt, isrmbg):
|
217 |
|
218 |
+
max_size = (1500,1500)
|
219 |
if prompt in prompt_list:
|
220 |
+
max_size = (1500,1500)
|
221 |
if isrmbg:
|
222 |
try:
|
223 |
rmbgfore = rmbg(fore)
|
|
|
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)
|
242 |
|
243 |
|
|
|
249 |
"prompt" : prompt,
|
250 |
"mode" : mode,
|
251 |
"intensity" : float(intensity),
|
252 |
+
"width" : 1500,
|
253 |
+
"height" : 1500,
|
254 |
"refprompt" : refprompt
|
255 |
}
|
256 |
#print(f"DATA: {data}")
|