Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,6 @@ def modify_caption(caption: str) -> str:
|
|
| 28 |
|
| 29 |
return re.sub(pattern, replace_fn, caption, count=1, flags=re.IGNORECASE)
|
| 30 |
|
| 31 |
-
|
| 32 |
def create_captions_rich(images):
|
| 33 |
captions = []
|
| 34 |
prompt = "caption en"
|
|
@@ -58,13 +57,13 @@ css = """
|
|
| 58 |
with gr.Blocks(css=css) as demo:
|
| 59 |
gr.HTML("<h1><center>Fine-tuned PaliGemma for SD3 Image Guided Prompt Generation.<center><h1>")
|
| 60 |
|
| 61 |
-
with gr.Tab(label="Image to Prompt for SD3
|
| 62 |
with gr.Row():
|
| 63 |
with gr.Column():
|
| 64 |
-
input_imgs = gr.Image(label="Input Images", type="pil",
|
| 65 |
submit_btn = gr.Button(value="Start")
|
| 66 |
-
outputs = gr.
|
| 67 |
|
| 68 |
-
submit_btn.click(create_captions_rich, [input_imgs], [outputs])
|
| 69 |
|
| 70 |
demo.launch(debug=True)
|
|
|
|
| 28 |
|
| 29 |
return re.sub(pattern, replace_fn, caption, count=1, flags=re.IGNORECASE)
|
| 30 |
|
|
|
|
| 31 |
def create_captions_rich(images):
|
| 32 |
captions = []
|
| 33 |
prompt = "caption en"
|
|
|
|
| 57 |
with gr.Blocks(css=css) as demo:
|
| 58 |
gr.HTML("<h1><center>Fine-tuned PaliGemma for SD3 Image Guided Prompt Generation.<center><h1>")
|
| 59 |
|
| 60 |
+
with gr.Tab(label="Image to Prompt for SD3"):
|
| 61 |
with gr.Row():
|
| 62 |
with gr.Column():
|
| 63 |
+
input_imgs = gr.Image(label="Input Images", type="pil", interactive=True, multiple=True)
|
| 64 |
submit_btn = gr.Button(value="Start")
|
| 65 |
+
outputs = gr.Textbox(label="Prompts", lines=10, interactive=False)
|
| 66 |
|
| 67 |
+
submit_btn.click(create_captions_rich, inputs=[input_imgs], outputs=[outputs])
|
| 68 |
|
| 69 |
demo.launch(debug=True)
|