before & after image slider
Browse files- app.py +4 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -11,6 +11,7 @@ from diffusers import FluxInpaintPipeline
|
|
11 |
from huggingface_hub import login
|
12 |
import os
|
13 |
import time
|
|
|
14 |
|
15 |
|
16 |
MARKDOWN = """
|
@@ -144,7 +145,7 @@ def process(
|
|
144 |
joint_attention_kwargs={"scale": lora_scale},
|
145 |
).images[0]
|
146 |
|
147 |
-
return result, resized_mask
|
148 |
|
149 |
|
150 |
with gr.Blocks() as demo:
|
@@ -238,8 +239,8 @@ with gr.Blocks() as demo:
|
|
238 |
value=20,
|
239 |
)
|
240 |
with gr.Column():
|
241 |
-
output_image_component =
|
242 |
-
|
243 |
with gr.Accordion("Debug", open=False):
|
244 |
output_mask_component = gr.Image(
|
245 |
type='pil', image_mode='RGB', label='Input mask', format="png")
|
|
|
11 |
from huggingface_hub import login
|
12 |
import os
|
13 |
import time
|
14 |
+
from gradio_imageslider import ImageSlider
|
15 |
|
16 |
|
17 |
MARKDOWN = """
|
|
|
145 |
joint_attention_kwargs={"scale": lora_scale},
|
146 |
).images[0]
|
147 |
|
148 |
+
return [resized_image, result], resized_mask
|
149 |
|
150 |
|
151 |
with gr.Blocks() as demo:
|
|
|
239 |
value=20,
|
240 |
)
|
241 |
with gr.Column():
|
242 |
+
output_image_component = ImageSlider(label="Generate image", type="pil", slider_color="pink")
|
243 |
+
|
244 |
with gr.Accordion("Debug", open=False):
|
245 |
output_mask_component = gr.Image(
|
246 |
type='pil', image_mode='RGB', label='Input mask', format="png")
|
requirements.txt
CHANGED
@@ -6,3 +6,4 @@ sentencepiece
|
|
6 |
git+https://github.com/Gothos/diffusers.git@flux-inpaint
|
7 |
huggingface_hub
|
8 |
peft
|
|
|
|
6 |
git+https://github.com/Gothos/diffusers.git@flux-inpaint
|
7 |
huggingface_hub
|
8 |
peft
|
9 |
+
gradio_imageslider
|