Spaces:
Kims12
/
Sleeping

Kims12 commited on
Commit
56b9002
ยท
verified ยท
1 Parent(s): aedf707

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -442,7 +442,7 @@ def generate_product_image(image, bg_type, simple, studio, nature, indoor, tech,
442
  "API ํ‚ค ์„ค์ • ๋ฐฉ๋ฒ•:\n"
443
  "1. ํ™˜๊ฒฝ ๋ณ€์ˆ˜: export GEMINI_API_KEY=\"your-api-key\"\n"
444
  "2. ์ฝ”๋“œ ๋‚ด ์ง์ ‘ ์ž…๋ ฅ: GEMINI_API_KEY = \"your-api-key\"\n"
445
- "ํ‚ค ๋ฐœ๊ธ‰: https://makersuite.google.com/"
446
  )
447
  return None, warning_msg, warning_msg
448
  final_prompt = filter_prompt_only(generated_prompt)
@@ -462,7 +462,7 @@ def generate_product_images(image, bg_type, simple, studio, nature, indoor, tech
462
  "API ํ‚ค ์„ค์ • ๋ฐฉ๋ฒ•:\n"
463
  "1. ํ™˜๊ฒฝ ๋ณ€์ˆ˜: export GEMINI_API_KEY=\"your-api-key\"\n"
464
  "2. ์ฝ”๋“œ ๋‚ด ์ง์ ‘ ์ž…๋ ฅ: GEMINI_API_KEY = \"your-api-key\"\n"
465
- "ํ‚ค ๋ฐœ๊ธ‰: https://makersuite.google.com/"
466
  )
467
  return None, None, None, None, warning_msg, warning_msg
468
  final_prompt = filter_prompt_only(generated_prompt)
@@ -484,11 +484,12 @@ def create_app():
484
  gr.Markdown("# ๊ณ ๊ธ‰ ์ƒํ’ˆ ์ด๋ฏธ์ง€ ๋ฐฐ๊ฒฝ ํ”„๋กฌํ”„ํŠธ ๋ฐ ์ด๋ฏธ์ง€ ์ƒ์„ฑ")
485
  gr.Markdown(
486
  "์ƒํ’ˆ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜๊ณ , ์ƒํ’ˆ๋ช…, ๋ฐฐ๊ฒฝ ์˜ต์…˜, ์ถ”๊ฐ€ ์š”์ฒญ์‚ฌํ•ญ ๋ฐ Gemini API ํ‚ค๋ฅผ ์ž…๋ ฅํ•˜๋ฉด Gemini API๋ฅผ ํ†ตํ•ด ์˜์–ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ํ•ด๋‹น ํ”„๋กฌํ”„ํŠธ๋กœ ์ด๋ฏธ์ง€๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.\n\n"
487
- "๋‹จ์ผ ์ด๋ฏธ์ง€ ์ƒ์„ฑ๊ณผ 4์žฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ ๋ชจ๋‘ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."
 
488
  )
489
 
490
  with gr.Row():
491
- # API ํ‚ค ์ž…๋ ฅ ํ•„๋“œ๋งŒ ํ‘œ์‹œ (API ํ‚ค ์ƒํƒœ, ์„ค์ • ๋ฒ„ํŠผ ์ œ๊ฑฐ)
492
  gemini_api_key = gr.Textbox(
493
  label="Gemini API ํ‚ค",
494
  type="password",
@@ -603,7 +604,6 @@ def create_app():
603
  def modified_single_image_gen(api_key, image, bg_type, simple, studio, nature, indoor, tech, colorful, abstract, jewelry, product_name, additional_info):
604
  os.environ["GEMINI_API_KEY"] = api_key.strip()
605
  result_img, status, _ = generate_product_image(image, bg_type, simple, studio, nature, indoor, tech, colorful, abstract, jewelry, product_name, additional_info)
606
- # ๋‹จ์ผ ์ด๋ฏธ์ง€๋Š” ์ฒซ ๋ฒˆ์งธ ์Šฌ๋กฏ์— ๋ฐฐ์น˜, ๋‚˜๋จธ์ง€๋Š” None ๋ฐ˜ํ™˜
607
  return result_img, None, None, None, status
608
 
609
  single_btn.click(
 
442
  "API ํ‚ค ์„ค์ • ๋ฐฉ๋ฒ•:\n"
443
  "1. ํ™˜๊ฒฝ ๋ณ€์ˆ˜: export GEMINI_API_KEY=\"your-api-key\"\n"
444
  "2. ์ฝ”๋“œ ๋‚ด ์ง์ ‘ ์ž…๋ ฅ: GEMINI_API_KEY = \"your-api-key\"\n"
445
+ "ํ‚ค ๋ฐœ๊ธ‰: https://aistudio.google.com/apikey"
446
  )
447
  return None, warning_msg, warning_msg
448
  final_prompt = filter_prompt_only(generated_prompt)
 
462
  "API ํ‚ค ์„ค์ • ๋ฐฉ๋ฒ•:\n"
463
  "1. ํ™˜๊ฒฝ ๋ณ€์ˆ˜: export GEMINI_API_KEY=\"your-api-key\"\n"
464
  "2. ์ฝ”๋“œ ๋‚ด ์ง์ ‘ ์ž…๋ ฅ: GEMINI_API_KEY = \"your-api-key\"\n"
465
+ "ํ‚ค ๋ฐœ๊ธ‰: https://aistudio.google.com/apikey"
466
  )
467
  return None, None, None, None, warning_msg, warning_msg
468
  final_prompt = filter_prompt_only(generated_prompt)
 
484
  gr.Markdown("# ๊ณ ๊ธ‰ ์ƒํ’ˆ ์ด๋ฏธ์ง€ ๋ฐฐ๊ฒฝ ํ”„๋กฌํ”„ํŠธ ๋ฐ ์ด๋ฏธ์ง€ ์ƒ์„ฑ")
485
  gr.Markdown(
486
  "์ƒํ’ˆ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜๊ณ , ์ƒํ’ˆ๋ช…, ๋ฐฐ๊ฒฝ ์˜ต์…˜, ์ถ”๊ฐ€ ์š”์ฒญ์‚ฌํ•ญ ๋ฐ Gemini API ํ‚ค๋ฅผ ์ž…๋ ฅํ•˜๋ฉด Gemini API๋ฅผ ํ†ตํ•ด ์˜์–ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ํ•ด๋‹น ํ”„๋กฌํ”„ํŠธ๋กœ ์ด๋ฏธ์ง€๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.\n\n"
487
+ "๋‹จ์ผ ์ด๋ฏธ์ง€ ์ƒ์„ฑ๊ณผ 4์žฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ ๋ชจ๋‘ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.\n\n"
488
+ "[Gemini API ํ‚ค ๋ฐ›๊ธฐ](https://aistudio.google.com/apikey)"
489
  )
490
 
491
  with gr.Row():
492
+ # API ํ‚ค ์ž…๋ ฅ ํ•„๋“œ๋งŒ ํ‘œ์‹œ
493
  gemini_api_key = gr.Textbox(
494
  label="Gemini API ํ‚ค",
495
  type="password",
 
604
  def modified_single_image_gen(api_key, image, bg_type, simple, studio, nature, indoor, tech, colorful, abstract, jewelry, product_name, additional_info):
605
  os.environ["GEMINI_API_KEY"] = api_key.strip()
606
  result_img, status, _ = generate_product_image(image, bg_type, simple, studio, nature, indoor, tech, colorful, abstract, jewelry, product_name, additional_info)
 
607
  return result_img, None, None, None, status
608
 
609
  single_btn.click(