Update app.py
Browse files
app.py
CHANGED
|
@@ -68,21 +68,20 @@ def change_product_angle(image_path):
|
|
| 68 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 69 |
|
| 70 |
try:
|
| 71 |
-
#
|
| 72 |
-
angle_prompt = "
|
| 73 |
|
| 74 |
output = replicate.run(
|
| 75 |
-
"
|
| 76 |
input={
|
| 77 |
-
"
|
| 78 |
-
"
|
| 79 |
-
"output_format": "jpg"
|
| 80 |
}
|
| 81 |
)
|
| 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 |
|
|
@@ -95,21 +94,20 @@ def add_shadow_only(image_path):
|
|
| 95 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 96 |
|
| 97 |
try:
|
| 98 |
-
#
|
| 99 |
-
shadow_prompt = "Add natural soft drop shadow
|
| 100 |
|
| 101 |
output = replicate.run(
|
| 102 |
-
"
|
| 103 |
input={
|
| 104 |
-
"
|
| 105 |
-
"
|
| 106 |
-
"output_format": "jpg"
|
| 107 |
}
|
| 108 |
)
|
| 109 |
|
| 110 |
response = requests.get(output)
|
| 111 |
if response.status_code == 200:
|
| 112 |
-
return Image.open(io.BytesIO(response.content)), "๊ทธ๋ฆผ์ ์ถ๊ฐ ์๋ฃ"
|
| 113 |
else:
|
| 114 |
return None, "๊ทธ๋ฆผ์ ์ถ๊ฐ ์คํจ"
|
| 115 |
|
|
|
|
| 68 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 69 |
|
| 70 |
try:
|
| 71 |
+
# SeedEdit 3.0์ ์ฌ์ฉํ ์นด๋ฉ๋ผ ์์น ๋ณ๊ฒฝ
|
| 72 |
+
angle_prompt = "Change camera angle to side view, rotate viewpoint 45 degrees, show product from different perspective, three-quarter angle view, diagonal camera position"
|
| 73 |
|
| 74 |
output = replicate.run(
|
| 75 |
+
"bytedance/seededit-3.0",
|
| 76 |
input={
|
| 77 |
+
"image": open(image_path, "rb"),
|
| 78 |
+
"prompt": angle_prompt
|
|
|
|
| 79 |
}
|
| 80 |
)
|
| 81 |
|
| 82 |
response = requests.get(output)
|
| 83 |
if response.status_code == 200:
|
| 84 |
+
return Image.open(io.BytesIO(response.content)), "์นด๋ฉ๋ผ ์ต๊ธ ๋ณ๊ฒฝ ์๋ฃ (SeedEdit)"
|
| 85 |
else:
|
| 86 |
return None, "์นด๋ฉ๋ผ ์ต๊ธ ๋ณ๊ฒฝ ์คํจ"
|
| 87 |
|
|
|
|
| 94 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 95 |
|
| 96 |
try:
|
| 97 |
+
# SeedEdit 3.0์ ์ฌ์ฉํ ๊ทธ๋ฆผ์ ์ถ๊ฐ
|
| 98 |
+
shadow_prompt = "Add natural soft drop shadow on pure white background, clean white backdrop, subtle shadow effect, professional product photography"
|
| 99 |
|
| 100 |
output = replicate.run(
|
| 101 |
+
"bytedance/seededit-3.0",
|
| 102 |
input={
|
| 103 |
+
"image": open(image_path, "rb"),
|
| 104 |
+
"prompt": shadow_prompt
|
|
|
|
| 105 |
}
|
| 106 |
)
|
| 107 |
|
| 108 |
response = requests.get(output)
|
| 109 |
if response.status_code == 200:
|
| 110 |
+
return Image.open(io.BytesIO(response.content)), "๊ทธ๋ฆผ์ ์ถ๊ฐ ์๋ฃ (SeedEdit)"
|
| 111 |
else:
|
| 112 |
return None, "๊ทธ๋ฆผ์ ์ถ๊ฐ ์คํจ"
|
| 113 |
|