Pierre Chapuis commited on
Commit
dd8f5e4
Β·
unverified Β·
1 Parent(s): a07bcfd

update to Gradio 5

Browse files
Files changed (4) hide show
  1. .gitignore +4 -0
  2. README.md +3 -3
  3. app.py +7 -13
  4. 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: 4.44.1
8
- python_version: 3.10
9
  app_file: app.py
10
  pinned: false
11
  license: other
12
- short_description: Switch lamps on in your images.
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
- Given an image with a lamp switched off, the model should turn it on.
58
- </p>
59
- <p>
60
- πŸ”Œ For higher resolution results with control over lighting intensity and warmth,&nbsp;
61
- <a href="https://finegrain.ai">head to the Finegrain API</a> πŸ”Œ
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@d288e94fa8eed1386bd28cd0d5ceb8109c3ff398
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