layerdiffusion commited on
Commit
0a6031f
β€’
1 Parent(s): 708f7b0
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +3 -1
  3. requirements.txt +1 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“ˆ
4
  colorFrom: yellow
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 3.41.2
8
  app_file: app.py
9
  pinned: false
10
  license: creativeml-openrail-m
 
4
  colorFrom: yellow
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 4.29.0
8
  app_file: app.py
9
  pinned: false
10
  license: creativeml-openrail-m
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import math
2
  import gradio as gr
3
  import numpy as np
@@ -332,6 +333,7 @@ def process(input_fg, prompt, image_width, image_height, num_samples, seed, step
332
  return pytorch2numpy(pixels)
333
 
334
 
 
335
  @torch.inference_mode()
336
  def process_relight(input_fg, prompt, image_width, image_height, num_samples, seed, steps, a_prompt, n_prompt, cfg, highres_scale, highres_denoise, lowres_denoise, bg_source):
337
  input_fg, matting = run_rmbg(input_fg)
@@ -382,7 +384,7 @@ with block:
382
  with gr.Row():
383
  with gr.Column():
384
  with gr.Row():
385
- input_fg = gr.Image(source='upload', type="numpy", label="Image", height=480)
386
  output_bg = gr.Image(type="numpy", label="Preprocessed Foreground", height=480)
387
  prompt = gr.Textbox(label="Prompt")
388
  bg_source = gr.Radio(choices=[e.value for e in BGSource],
 
1
+ import spaces
2
  import math
3
  import gradio as gr
4
  import numpy as np
 
333
  return pytorch2numpy(pixels)
334
 
335
 
336
+ @spaces.GPU
337
  @torch.inference_mode()
338
  def process_relight(input_fg, prompt, image_width, image_height, num_samples, seed, steps, a_prompt, n_prompt, cfg, highres_scale, highres_denoise, lowres_denoise, bg_source):
339
  input_fg, matting = run_rmbg(input_fg)
 
384
  with gr.Row():
385
  with gr.Column():
386
  with gr.Row():
387
+ input_fg = gr.Image(sources='upload', type="numpy", label="Image", height=480)
388
  output_bg = gr.Image(type="numpy", label="Preprocessed Foreground", height=480)
389
  prompt = gr.Textbox(label="Prompt")
390
  bg_source = gr.Radio(choices=[e.value for e in BGSource],
requirements.txt CHANGED
@@ -7,5 +7,5 @@ safetensors
7
  pillow==10.2.0
8
  einops
9
  peft
10
- gradio==3.41.2
11
  protobuf==3.20
 
7
  pillow==10.2.0
8
  einops
9
  peft
10
+ gradio==4.29.0
11
  protobuf==3.20