Spaces:
Running
Running
change ui
Browse files
app.py
CHANGED
@@ -32,14 +32,11 @@ def generate_image(input_image, style_images):
|
|
32 |
|
33 |
inputImageUrl = prefix + input_image
|
34 |
|
35 |
-
print(f"Input Image URL: {inputImageUrl}")
|
36 |
-
|
37 |
result_images = list[str]()
|
38 |
for style_image in style_images:
|
39 |
if not style_image:
|
40 |
raise gr.Error(f"Cannot find any style image! Please refer to step 1️⃣")
|
41 |
styleImageUrl = prefix + style_image[0]
|
42 |
-
print(f"Style Image URL: {styleImageUrl}")
|
43 |
result_images.append(change_image_style(inputImageUrl, styleImageUrl))
|
44 |
|
45 |
return result_images
|
@@ -54,7 +51,6 @@ def remove_back_to_files():
|
|
54 |
with gr.Blocks() as demo:
|
55 |
with gr.Row():
|
56 |
with gr.Column():
|
57 |
-
input_image = gr.Image(label="Input Image", type="filepath", interactive=True)
|
58 |
|
59 |
files = gr.File(
|
60 |
label="Drag (Select) 1 or more style images",
|
@@ -64,6 +60,7 @@ with gr.Blocks() as demo:
|
|
64 |
uploaded_files = gr.Gallery(label="Your images", visible=False, columns=5, rows=1, height=200)
|
65 |
with gr.Column(visible=False) as clear_button:
|
66 |
remove_and_reupload = gr.ClearButton(value="Remove and upload new ones", components=files, size="sm")
|
|
|
67 |
submit = gr.Button("Submit")
|
68 |
|
69 |
with gr.Column():
|
|
|
32 |
|
33 |
inputImageUrl = prefix + input_image
|
34 |
|
|
|
|
|
35 |
result_images = list[str]()
|
36 |
for style_image in style_images:
|
37 |
if not style_image:
|
38 |
raise gr.Error(f"Cannot find any style image! Please refer to step 1️⃣")
|
39 |
styleImageUrl = prefix + style_image[0]
|
|
|
40 |
result_images.append(change_image_style(inputImageUrl, styleImageUrl))
|
41 |
|
42 |
return result_images
|
|
|
51 |
with gr.Blocks() as demo:
|
52 |
with gr.Row():
|
53 |
with gr.Column():
|
|
|
54 |
|
55 |
files = gr.File(
|
56 |
label="Drag (Select) 1 or more style images",
|
|
|
60 |
uploaded_files = gr.Gallery(label="Your images", visible=False, columns=5, rows=1, height=200)
|
61 |
with gr.Column(visible=False) as clear_button:
|
62 |
remove_and_reupload = gr.ClearButton(value="Remove and upload new ones", components=files, size="sm")
|
63 |
+
input_image = gr.Image(label="Input Image", type="filepath", interactive=True)
|
64 |
submit = gr.Button("Submit")
|
65 |
|
66 |
with gr.Column():
|