Spaces:
Running
on
Zero
Running
on
Zero
Pierre Chapuis
commited on
update to Gradio 5
Browse files- .gitignore +4 -0
- README.md +3 -3
- app.py +7 -13
- requirements.txt +2 -3
.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.gradio/
|
2 |
+
|
3 |
+
__pycache__/
|
4 |
+
*.py[cod]
|
README.md
CHANGED
@@ -4,12 +4,12 @@ emoji: π‘
|
|
4 |
colorFrom: yellow
|
5 |
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
-
python_version: 3.
|
9 |
app_file: app.py
|
10 |
pinned: false
|
11 |
license: other
|
12 |
-
short_description:
|
13 |
tags:
|
14 |
- refiners
|
15 |
- image-to-image
|
|
|
4 |
colorFrom: yellow
|
5 |
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 5.27.1
|
8 |
+
python_version: 3.12
|
9 |
app_file: app.py
|
10 |
pinned: false
|
11 |
license: other
|
12 |
+
short_description: Instantly turn lamps on in your images
|
13 |
tags:
|
14 |
- refiners
|
15 |
- image-to-image
|
app.py
CHANGED
@@ -8,7 +8,6 @@ import pillow_avif # noqa: F401
|
|
8 |
import pillow_heif
|
9 |
import spaces
|
10 |
import torch
|
11 |
-
from gradio_imageslider import ImageSlider
|
12 |
from PIL import Image
|
13 |
|
14 |
|
@@ -54,16 +53,11 @@ def process(input_image: Image.Image, seed: int = 42) -> tuple[tuple[Image.Image
|
|
54 |
TITLE = """
|
55 |
<h1>Finegrain Light Switcher (Lite Version)</h1>
|
56 |
<p>
|
57 |
-
|
58 |
-
</p>
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
</p>
|
63 |
-
<p>
|
64 |
-
<a href="https://discord.gg/zFKg5TjXub" target="_blank">[Discord]</a>
|
65 |
-
<a href="https://github.com/finegrain-ai" target="_blank">[GitHub]</a>
|
66 |
-
<a href="https://finegrain.ai">[Finegrain API]</a>
|
67 |
</p>
|
68 |
"""
|
69 |
|
@@ -86,7 +80,7 @@ with gr.Blocks() as demo:
|
|
86 |
input_image = gr.Image(type="pil", label="Input Image")
|
87 |
run_button = gr.ClearButton(components=None, value=random.choice(BUTTON_LABELS))
|
88 |
with gr.Column():
|
89 |
-
output_slider = ImageSlider(label="Before / After")
|
90 |
run_button.add(output_slider)
|
91 |
|
92 |
with gr.Accordion("Advanced Options", open=False):
|
@@ -113,4 +107,4 @@ with gr.Blocks() as demo:
|
|
113 |
run_on_click=False,
|
114 |
)
|
115 |
|
116 |
-
demo.launch(share=False)
|
|
|
8 |
import pillow_heif
|
9 |
import spaces
|
10 |
import torch
|
|
|
11 |
from PIL import Image
|
12 |
|
13 |
|
|
|
53 |
TITLE = """
|
54 |
<h1>Finegrain Light Switcher (Lite Version)</h1>
|
55 |
<p>
|
56 |
+
Instantly turn lamps on in your images.
|
57 |
+
</p><p>
|
58 |
+
For premium-quality results,
|
59 |
+
<a href="https://chat.finegrain.ai?utm_source=hf&utm_campaign=light-switcher">try Finegrain Chat</a>
|
60 |
+
β it's free to test!
|
|
|
|
|
|
|
|
|
|
|
61 |
</p>
|
62 |
"""
|
63 |
|
|
|
80 |
input_image = gr.Image(type="pil", label="Input Image")
|
81 |
run_button = gr.ClearButton(components=None, value=random.choice(BUTTON_LABELS))
|
82 |
with gr.Column():
|
83 |
+
output_slider = gr.ImageSlider(label="Before / After", max_height=1500, show_fullscreen_button=False)
|
84 |
run_button.add(output_slider)
|
85 |
|
86 |
with gr.Accordion("Advanced Options", open=False):
|
|
|
107 |
run_on_click=False,
|
108 |
)
|
109 |
|
110 |
+
demo.launch(share=False, ssr_mode=False)
|
requirements.txt
CHANGED
@@ -1,7 +1,6 @@
|
|
|
|
1 |
git+https://github.com/huggingface/diffusers@97abdd2210a540c2e71aee63c80a22723031cd57
|
2 |
-
git+https://github.com/finegrain-ai/refiners@
|
3 |
-
gradio_imageslider==0.0.20
|
4 |
-
spaces==0.32.0
|
5 |
numpy<2.0.0
|
6 |
pillow>=10.4.0
|
7 |
pillow-heif>=0.18.0
|
|
|
1 |
+
spaces>=0.35.0
|
2 |
git+https://github.com/huggingface/diffusers@97abdd2210a540c2e71aee63c80a22723031cd57
|
3 |
+
git+https://github.com/finegrain-ai/refiners@cfe8b66ba4f8a906583850ac25e9e89cb83a44b9
|
|
|
|
|
4 |
numpy<2.0.0
|
5 |
pillow>=10.4.0
|
6 |
pillow-heif>=0.18.0
|