Update app.py
Browse files
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://
|
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://
|
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 ํค ์
๋ ฅ ํ๋๋ง ํ์
|
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(
|