Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -302,6 +302,8 @@ def process_prompt(img: Image.Image, prompt: str, bg_prompt: str | None = None,
|
|
| 302 |
if img is None or prompt.strip() == "":
|
| 303 |
raise gr.Error("Please provide both image and prompt")
|
| 304 |
|
|
|
|
|
|
|
| 305 |
# 프롬프트 번역
|
| 306 |
prompt = translate_to_english(prompt)
|
| 307 |
if bg_prompt:
|
|
@@ -318,10 +320,12 @@ def process_prompt(img: Image.Image, prompt: str, bg_prompt: str | None = None,
|
|
| 318 |
position=position,
|
| 319 |
scale_percent=scale_percent
|
| 320 |
)
|
|
|
|
| 321 |
return combined, results[2]
|
| 322 |
|
| 323 |
return results[1], results[2]
|
| 324 |
except Exception as e:
|
|
|
|
| 325 |
raise gr.Error(str(e))
|
| 326 |
|
| 327 |
def process_bbox(img: Image.Image, box_input: str) -> tuple[Image.Image, Image.Image]:
|
|
|
|
| 302 |
if img is None or prompt.strip() == "":
|
| 303 |
raise gr.Error("Please provide both image and prompt")
|
| 304 |
|
| 305 |
+
print(f"Processing with position: {position}, scale: {scale_percent}") # 디버그 로그
|
| 306 |
+
|
| 307 |
# 프롬프트 번역
|
| 308 |
prompt = translate_to_english(prompt)
|
| 309 |
if bg_prompt:
|
|
|
|
| 320 |
position=position,
|
| 321 |
scale_percent=scale_percent
|
| 322 |
)
|
| 323 |
+
print(f"Combined image created with position: {position}") # 디버그 로그
|
| 324 |
return combined, results[2]
|
| 325 |
|
| 326 |
return results[1], results[2]
|
| 327 |
except Exception as e:
|
| 328 |
+
print(f"Error in process_prompt: {str(e)}") # 디버그 로그
|
| 329 |
raise gr.Error(str(e))
|
| 330 |
|
| 331 |
def process_bbox(img: Image.Image, box_input: str) -> tuple[Image.Image, Image.Image]:
|