Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -919,7 +919,41 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
919 |
)
|
920 |
|
921 |
|
922 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
923 |
process_btn.click(
|
924 |
fn=process_prompt,
|
925 |
inputs=[
|
@@ -954,43 +988,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
954 |
show_progress=True
|
955 |
)
|
956 |
|
957 |
-
|
958 |
-
|
959 |
-
# 추가: 결과 이미지 업데이트를 위한 이벤트
|
960 |
-
combined_image.change(
|
961 |
-
fn=lambda x: x,
|
962 |
-
inputs=combined_image,
|
963 |
-
outputs=combined_image,
|
964 |
-
queue=False
|
965 |
-
)
|
966 |
-
|
967 |
-
|
968 |
-
bg_prompt.change(
|
969 |
-
fn=update_controls,
|
970 |
-
inputs=bg_prompt,
|
971 |
-
outputs=[aspect_ratio, object_controls],
|
972 |
-
queue=False
|
973 |
-
)
|
974 |
-
|
975 |
-
input_image.change(
|
976 |
-
fn=update_process_button,
|
977 |
-
inputs=[input_image, text_prompt],
|
978 |
-
outputs=process_btn,
|
979 |
-
queue=False
|
980 |
-
)
|
981 |
-
|
982 |
-
text_prompt.change(
|
983 |
-
fn=update_process_button,
|
984 |
-
inputs=[input_image, text_prompt],
|
985 |
-
outputs=process_btn,
|
986 |
-
queue=False
|
987 |
-
)
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
# demo 설정 수정
|
993 |
-
demo.queue(max_size=10
|
994 |
demo.launch(
|
995 |
server_name="0.0.0.0",
|
996 |
server_port=7860,
|
@@ -998,4 +997,4 @@ demo.launch(
|
|
998 |
max_threads=4,
|
999 |
show_error=True,
|
1000 |
prevent_thread_lock=True
|
1001 |
-
)
|
|
|
919 |
)
|
920 |
|
921 |
|
922 |
+
# 추가: 결과 이미지 업데이트를 위한 이벤트
|
923 |
+
combined_image.change(
|
924 |
+
fn=lambda x: x,
|
925 |
+
inputs=combined_image,
|
926 |
+
outputs=combined_image,
|
927 |
+
queue=False
|
928 |
+
)
|
929 |
+
|
930 |
+
|
931 |
+
bg_prompt.change(
|
932 |
+
fn=update_controls,
|
933 |
+
inputs=bg_prompt,
|
934 |
+
outputs=[aspect_ratio, object_controls],
|
935 |
+
queue=False
|
936 |
+
)
|
937 |
+
|
938 |
+
input_image.change(
|
939 |
+
fn=update_process_button,
|
940 |
+
inputs=[input_image, text_prompt],
|
941 |
+
outputs=process_btn,
|
942 |
+
queue=False
|
943 |
+
)
|
944 |
+
|
945 |
+
text_prompt.change(
|
946 |
+
fn=update_process_button,
|
947 |
+
inputs=[input_image, text_prompt],
|
948 |
+
outputs=process_btn,
|
949 |
+
queue=False
|
950 |
+
)
|
951 |
+
|
952 |
+
|
953 |
+
|
954 |
+
|
955 |
+
|
956 |
+
# 이벤트 바인딩
|
957 |
process_btn.click(
|
958 |
fn=process_prompt,
|
959 |
inputs=[
|
|
|
988 |
show_progress=True
|
989 |
)
|
990 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
991 |
# demo 설정 수정
|
992 |
+
demo.queue(max_size=10) # concurrency_count 제거
|
993 |
demo.launch(
|
994 |
server_name="0.0.0.0",
|
995 |
server_port=7860,
|
|
|
997 |
max_threads=4,
|
998 |
show_error=True,
|
999 |
prevent_thread_lock=True
|
1000 |
+
)
|