Update app.py
Browse files
app.py
CHANGED
|
@@ -68,16 +68,20 @@ def change_product_angle(image_path):
|
|
| 68 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 69 |
|
| 70 |
try:
|
| 71 |
-
# Gen4 Image
|
| 72 |
-
angle_prompt = "Professional product photography from 45-degree side angle, three-quarter view, diagonal perspective, different camera position, clean background
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
response = requests.get(output)
|
| 83 |
if response.status_code == 200:
|
|
@@ -94,16 +98,20 @@ def add_shadow_only(image_path):
|
|
| 94 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 95 |
|
| 96 |
try:
|
| 97 |
-
# Gen4 Image
|
| 98 |
-
shadow_prompt = "Professional product photography on pure white background with natural soft drop shadow, clean white backdrop, subtle shadow effect, e-commerce style
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
response = requests.get(output)
|
| 109 |
if response.status_code == 200:
|
|
|
|
| 68 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 69 |
|
| 70 |
try:
|
| 71 |
+
# Gen4 Image๋ก ์นด๋ฉ๋ผ ์์น ๋ณ๊ฒฝ (ํ์ผ ์ง์ ์
๋ก๋)
|
| 72 |
+
angle_prompt = "Professional product photography of @product from 45-degree side angle, three-quarter view, diagonal perspective, different camera position, clean background"
|
| 73 |
|
| 74 |
+
with open(image_path, "rb") as image_file:
|
| 75 |
+
output = replicate.run(
|
| 76 |
+
"runwayml/gen4-image",
|
| 77 |
+
input={
|
| 78 |
+
"prompt": angle_prompt,
|
| 79 |
+
"aspect_ratio": "1:1",
|
| 80 |
+
"resolution": "1080p",
|
| 81 |
+
"reference_images": [image_file],
|
| 82 |
+
"reference_tags": ["product"]
|
| 83 |
+
}
|
| 84 |
+
)
|
| 85 |
|
| 86 |
response = requests.get(output)
|
| 87 |
if response.status_code == 200:
|
|
|
|
| 98 |
return None, "Replicate API ํ ํฐ์ด ํ์ํฉ๋๋ค."
|
| 99 |
|
| 100 |
try:
|
| 101 |
+
# Gen4 Image๋ก ๊ทธ๋ฆผ์ ์ถ๊ฐ (ํ์ผ ์ง์ ์
๋ก๋)
|
| 102 |
+
shadow_prompt = "Professional product photography of @product on pure white background with natural soft drop shadow, clean white backdrop, subtle shadow effect, e-commerce style"
|
| 103 |
|
| 104 |
+
with open(image_path, "rb") as image_file:
|
| 105 |
+
output = replicate.run(
|
| 106 |
+
"runwayml/gen4-image",
|
| 107 |
+
input={
|
| 108 |
+
"prompt": shadow_prompt,
|
| 109 |
+
"aspect_ratio": "1:1",
|
| 110 |
+
"resolution": "1080p",
|
| 111 |
+
"reference_images": [image_file],
|
| 112 |
+
"reference_tags": ["product"]
|
| 113 |
+
}
|
| 114 |
+
)
|
| 115 |
|
| 116 |
response = requests.get(output)
|
| 117 |
if response.status_code == 200:
|