Update app.py
Browse files
app.py
CHANGED
@@ -106,8 +106,8 @@ def preprocess_prompt(prompt, image1, image2, image3):
|
|
106 |
elif "5. 배경바꾸기" in prompt:
|
107 |
prompt = "첫 번째 이미지의 배경을 두 번째 이미지의 배경으로 변경해주세요. 첫 번째 이미지의 주요 피사체는 유지하고, 두 번째 이미지의 배경과 조화롭게 합성해주세요."
|
108 |
|
109 |
-
elif "
|
110 |
-
prompt = "
|
111 |
|
112 |
prompt += " 이미지를 생성해주세요."
|
113 |
return prompt
|
@@ -233,7 +233,8 @@ with gr.Blocks() as demo:
|
|
233 |
text_remove_btn = gr.Button("글자지우기")
|
234 |
clothes_change_btn = gr.Button("옷바꾸기")
|
235 |
background_change_btn = gr.Button("배경바꾸기")
|
236 |
-
|
|
|
237 |
submit_btn = gr.Button("이미지 생성", variant="primary")
|
238 |
with gr.Column():
|
239 |
output_image = gr.Image(label="생성된 이미지")
|
@@ -262,7 +263,7 @@ with gr.Blocks() as demo:
|
|
262 |
outputs=prompt_input
|
263 |
)
|
264 |
composite_product_btn.click(
|
265 |
-
fn=lambda: "#1
|
266 |
inputs=[],
|
267 |
outputs=prompt_input
|
268 |
)
|
@@ -286,4 +287,4 @@ with gr.Blocks() as demo:
|
|
286 |
)
|
287 |
|
288 |
if __name__ == "__main__":
|
289 |
-
demo.launch(share=True)
|
|
|
106 |
elif "5. 배경바꾸기" in prompt:
|
107 |
prompt = "첫 번째 이미지의 배경을 두 번째 이미지의 배경으로 변경해주세요. 첫 번째 이미지의 주요 피사체는 유지하고, 두 번째 이미지의 배경과 조화롭게 합성해주세요."
|
108 |
|
109 |
+
elif "상품합성" in prompt:
|
110 |
+
prompt = "#1 상품 이미지에 #2 이미지 또는 #3 이미지를 [모든 이미지의 주요 요소를 포함하고, 특히 상품이 돋보이도록 조화롭게 통합하여]자연스럽게 합성하라."
|
111 |
|
112 |
prompt += " 이미지를 생성해주세요."
|
113 |
return prompt
|
|
|
233 |
text_remove_btn = gr.Button("글자지우기")
|
234 |
clothes_change_btn = gr.Button("옷바꾸기")
|
235 |
background_change_btn = gr.Button("배경바꾸기")
|
236 |
+
# 버튼 라벨과 클릭 시 반환되는 프롬프트 수정
|
237 |
+
composite_product_btn = gr.Button("상품합성")
|
238 |
submit_btn = gr.Button("이미지 생성", variant="primary")
|
239 |
with gr.Column():
|
240 |
output_image = gr.Image(label="생성된 이미지")
|
|
|
263 |
outputs=prompt_input
|
264 |
)
|
265 |
composite_product_btn.click(
|
266 |
+
fn=lambda: "#1 상품 이미지에 #2 이미지 또는 #3 이미지를 [모든 이미지의 주요 요소를 포함하고, 특히 상품이 돋보이도록 조화롭게 통합하여]자연스럽게 합성하라.",
|
267 |
inputs=[],
|
268 |
outputs=prompt_input
|
269 |
)
|
|
|
287 |
)
|
288 |
|
289 |
if __name__ == "__main__":
|
290 |
+
demo.launch(share=True)
|