Update app.py
Browse files
app.py
CHANGED
|
@@ -63,13 +63,13 @@ def upscale_with_clarity(image_path):
|
|
| 63 |
return None, f"ํ์ง ๊ฐ์ ์ค๋ฅ: {str(e)}"
|
| 64 |
|
| 65 |
def change_product_angle(image_path):
|
| 66 |
-
"""
|
| 67 |
if not REPLICATE_API_TOKEN:
|
| 68 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 69 |
|
| 70 |
try:
|
| 71 |
-
#
|
| 72 |
-
angle_prompt = "IMPORTANT:
|
| 73 |
|
| 74 |
output = replicate.run(
|
| 75 |
"black-forest-labs/flux-kontext-pro",
|
|
@@ -82,12 +82,12 @@ def change_product_angle(image_path):
|
|
| 82 |
|
| 83 |
response = requests.get(output)
|
| 84 |
if response.status_code == 200:
|
| 85 |
-
return Image.open(io.BytesIO(response.content)), "
|
| 86 |
else:
|
| 87 |
-
return None, "
|
| 88 |
|
| 89 |
except Exception as e:
|
| 90 |
-
return None, f"
|
| 91 |
|
| 92 |
def add_shadow_only(image_path):
|
| 93 |
"""๋ฐฐ๊ฒฝ ์ ๊ฑฐ๋ ์ํ์ ๊ทธ๋ฆผ์๋ง ์ถ๊ฐ (์์ ํ ํฐ์ ๋ฐฐ๊ฒฝ)"""
|
|
|
|
| 63 |
return None, f"ํ์ง ๊ฐ์ ์ค๋ฅ: {str(e)}"
|
| 64 |
|
| 65 |
def change_product_angle(image_path):
|
| 66 |
+
"""์นด๋ฉ๋ผ ์์น๋ฅผ ๋ฐ๊ฟ์ ๋ค๋ฅธ ์ต๊ธ๋ก ์ดฌ์"""
|
| 67 |
if not REPLICATE_API_TOKEN:
|
| 68 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 69 |
|
| 70 |
try:
|
| 71 |
+
# ์นด๋ฉ๋ผ ์์น ๋ณ๊ฒฝ ํ๋กฌํํธ (์ดฌ์ ์ต๊ธ ๋ณ๊ฒฝ)
|
| 72 |
+
angle_prompt = "IMPORTANT: Change camera position and shooting angle! Move camera to side view, photograph from different angle, change viewpoint from front to side perspective, shot from 45-degree side angle, camera repositioning, different photography angle, side profile view, alternative camera angle, shoot from diagonal perspective, change photographic viewpoint"
|
| 73 |
|
| 74 |
output = replicate.run(
|
| 75 |
"black-forest-labs/flux-kontext-pro",
|
|
|
|
| 82 |
|
| 83 |
response = requests.get(output)
|
| 84 |
if response.status_code == 200:
|
| 85 |
+
return Image.open(io.BytesIO(response.content)), "์นด๋ฉ๋ผ ์ต๊ธ ๋ณ๊ฒฝ ์๋ฃ"
|
| 86 |
else:
|
| 87 |
+
return None, "์นด๋ฉ๋ผ ์ต๊ธ ๋ณ๊ฒฝ ์คํจ"
|
| 88 |
|
| 89 |
except Exception as e:
|
| 90 |
+
return None, f"์นด๋ฉ๋ผ ์ต๊ธ ๋ณ๊ฒฝ ์ค๋ฅ: {str(e)}"
|
| 91 |
|
| 92 |
def add_shadow_only(image_path):
|
| 93 |
"""๋ฐฐ๊ฒฝ ์ ๊ฑฐ๋ ์ํ์ ๊ทธ๋ฆผ์๋ง ์ถ๊ฐ (์์ ํ ํฐ์ ๋ฐฐ๊ฒฝ)"""
|