Update app.py
Browse files
app.py
CHANGED
@@ -323,13 +323,6 @@ def edit_image(input_image, password, korean_prompt, output_format, aspect_ratio
|
|
323 |
"aspect_ratio": aspect_ratio
|
324 |
}
|
325 |
|
326 |
-
log_message("FLUX API ํธ์ถ ํ๋ผ๋ฏธํฐ:", log_list)
|
327 |
-
log_message(f" - ํ๋กฌํํธ: '{english_prompt}'", log_list)
|
328 |
-
log_message(f" - ์ถ๋ ฅ ํฌ๋งท: {output_format.lower()}", log_list)
|
329 |
-
log_message(f" - ํ๋ฉด ๋น์จ: {aspect_ratio}", log_list)
|
330 |
-
|
331 |
-
log_message("FLUX ๋ชจ๋ธ API ํธ์ถ ์์...", log_list)
|
332 |
-
log_message("๋ชจ๋ธ: black-forest-labs/flux-kontext-pro", log_list)
|
333 |
|
334 |
flux_start_time = time.time()
|
335 |
try:
|
@@ -492,13 +485,6 @@ try:
|
|
492 |
print("โ
๋ชจ๋ API ํค๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ค์ ๋์์ต๋๋ค.")
|
493 |
except ValueError as e:
|
494 |
print(f"โ {e}")
|
495 |
-
print("\n๐ง ํ๊ฒฝ๋ณ์ ์ค์ ๋ฐฉ๋ฒ:")
|
496 |
-
print("Hugging Face Spaces์์:")
|
497 |
-
print("1. Settings > Repository secrets ๋ก ์ด๋")
|
498 |
-
print("2. ๋ค์ ํ๊ฒฝ๋ณ์๋ค์ ์ถ๊ฐํ์ธ์:")
|
499 |
-
print(" - REPLICATE_API_TOKEN: Replicate API ํ ํฐ")
|
500 |
-
print(" - GEMINI_API_KEY: Google Gemini API ํค")
|
501 |
-
print(" - APP_PASSWORD: ์ ํ๋ฆฌ์ผ์ด์
๋น๋ฐ๋ฒํธ (์ ํ์ฌํญ)")
|
502 |
|
503 |
# Gradio ์ธํฐํ์ด์ค
|
504 |
with gr.Blocks(title="์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )") as demo:
|
@@ -507,6 +493,7 @@ with gr.Blocks(title="์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )") as demo:
|
|
507 |
saved_downloads = gr.State([])
|
508 |
|
509 |
gr.Markdown("# ๐จ AI ์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )")
|
|
|
510 |
with gr.Row():
|
511 |
with gr.Column():
|
512 |
input_image = gr.Image(type="filepath", label="๐ค ์
๋ ฅ ์ด๋ฏธ์ง")
|
@@ -563,7 +550,6 @@ with gr.Blocks(title="์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )") as demo:
|
|
563 |
rows=2,
|
564 |
height="auto"
|
565 |
)
|
566 |
-
|
567 |
|
568 |
# ์ด๋ฒคํธ ํธ๋ค๋ฌ
|
569 |
edit_btn.click(
|
@@ -587,10 +573,7 @@ with gr.Blocks(title="์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )") as demo:
|
|
587 |
|
588 |
if __name__ == "__main__":
|
589 |
print("๐ ์ด๋ฏธ์ง ํธ์ง ์ ํ๋ฆฌ์ผ์ด์
์์ ์ค...")
|
590 |
-
|
591 |
-
print("๐ ์์ธ ๋ก๊ทธ ์์คํ
์ด ํ์ฑํ๋์์ต๋๋ค.")
|
592 |
-
print("๐ ๋ชจ๋ API ํธ์ถ๊ณผ ์ฒ๋ฆฌ ๊ณผ์ ์ด ์ค์๊ฐ์ผ๋ก ๊ธฐ๋ก๋ฉ๋๋ค.")
|
593 |
-
|
594 |
# API ํค ์ํ ํ์ธ
|
595 |
try:
|
596 |
validate_api_keys()
|
|
|
323 |
"aspect_ratio": aspect_ratio
|
324 |
}
|
325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
|
327 |
flux_start_time = time.time()
|
328 |
try:
|
|
|
485 |
print("โ
๋ชจ๋ API ํค๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ค์ ๋์์ต๋๋ค.")
|
486 |
except ValueError as e:
|
487 |
print(f"โ {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
|
489 |
# Gradio ์ธํฐํ์ด์ค
|
490 |
with gr.Blocks(title="์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )") as demo:
|
|
|
493 |
saved_downloads = gr.State([])
|
494 |
|
495 |
gr.Markdown("# ๐จ AI ์ด๋ฏธ์ง ํธ์ง๊ธฐ (๋ณด์ ๊ฐํ ๋ฒ์ )")
|
496 |
+
|
497 |
with gr.Row():
|
498 |
with gr.Column():
|
499 |
input_image = gr.Image(type="filepath", label="๐ค ์
๋ ฅ ์ด๋ฏธ์ง")
|
|
|
550 |
rows=2,
|
551 |
height="auto"
|
552 |
)
|
|
|
553 |
|
554 |
# ์ด๋ฒคํธ ํธ๋ค๋ฌ
|
555 |
edit_btn.click(
|
|
|
573 |
|
574 |
if __name__ == "__main__":
|
575 |
print("๐ ์ด๋ฏธ์ง ํธ์ง ์ ํ๋ฆฌ์ผ์ด์
์์ ์ค...")
|
576 |
+
|
|
|
|
|
|
|
577 |
# API ํค ์ํ ํ์ธ
|
578 |
try:
|
579 |
validate_api_keys()
|