Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,20 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import math
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
|
@@ -333,7 +349,7 @@ def process(input_fg, prompt, image_width, image_height, num_samples, seed, step
|
|
| 333 |
return pytorch2numpy(pixels)
|
| 334 |
|
| 335 |
|
| 336 |
-
|
| 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)
|
|
@@ -430,4 +446,4 @@ with block:
|
|
| 430 |
example_quick_subjects.click(lambda x: x[0], inputs=example_quick_subjects, outputs=prompt, show_progress=False, queue=False)
|
| 431 |
|
| 432 |
|
| 433 |
-
block.launch(
|
|
|
|
| 1 |
+
'''
|
| 2 |
+
sudo apt-get update && sudo apt-get install git-lfs ffmpeg cbm
|
| 3 |
+
# Clone this repository
|
| 4 |
+
git clone https://huggingface.co/spaces/svjack/IC-Light
|
| 5 |
+
# Go into the repository
|
| 6 |
+
cd IC-Light
|
| 7 |
+
### Install dependencies ###
|
| 8 |
+
conda create --name py310 python=3.10
|
| 9 |
+
conda activate py310
|
| 10 |
+
# Install ipykernel and add the environment to Jupyter
|
| 11 |
+
pip install ipykernel
|
| 12 |
+
python -m ipykernel install --user --name py310 --display-name "py310"
|
| 13 |
+
pip install -r requirements.txt
|
| 14 |
+
python app.py
|
| 15 |
+
'''
|
| 16 |
+
|
| 17 |
+
#import spaces
|
| 18 |
import math
|
| 19 |
import gradio as gr
|
| 20 |
import numpy as np
|
|
|
|
| 349 |
return pytorch2numpy(pixels)
|
| 350 |
|
| 351 |
|
| 352 |
+
#@spaces.GPU
|
| 353 |
@torch.inference_mode()
|
| 354 |
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):
|
| 355 |
input_fg, matting = run_rmbg(input_fg)
|
|
|
|
| 446 |
example_quick_subjects.click(lambda x: x[0], inputs=example_quick_subjects, outputs=prompt, show_progress=False, queue=False)
|
| 447 |
|
| 448 |
|
| 449 |
+
block.launch(share = True)
|