ssboost commited on
Commit
71c40f6
ยท
verified ยท
1 Parent(s): 70d11a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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: Rotate and tilt the product to a completely different angle! Change from current view to dramatic 45-degree diagonal angle, rotate the product clockwise, tilt perspective view, turn the object sideways, change orientation significantly, make it look like photographed from a different camera position, professional product photography with strong angular change, dramatic viewpoint shift"
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"๊ฐ๋„ ๋ณ€๊ฒฝ ์˜ค๋ฅ˜: {str(e)}"
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
  """๋ฐฐ๊ฒฝ ์ œ๊ฑฐ๋œ ์ƒํ’ˆ์— ๊ทธ๋ฆผ์ž๋งŒ ์ถ”๊ฐ€ (์™„์ „ํ•œ ํฐ์ƒ‰ ๋ฐฐ๊ฒฝ)"""